[MainWindow] Fix version injection, rewrite GM inject waiting

This commit is contained in:
Ducko 2022-01-08 22:02:32 +00:00
parent 3721a3e0f1
commit 9a55abcd9c

View file

@ -20,17 +20,17 @@ setInterval(themesync, 3000);
const css = ` const css = `
.socialLinks-3jqNFy + .info-1VyQPT .colorMuted-HdFt4q:nth-last-child(2)::after { [class^="socialLinks-"] + [class^="info-"] [class^="colorMuted-"]:nth-last-child(2)::after {
content: " | OpenAsar <oa_version_hash>"; content: " | OpenAsar <oa_version_hash>";
display: inline; display: inline;
text-transform: none; text-transform: none;
} }
.socialLinks-3jqNFy + .info-1VyQPT { [class^="socialLinks-"] + [class^="info-"] {
padding-right: 0; padding-right: 0;
} }
.vertical-V37hAW > div[style="display: flex; justify-content: space-between;"] > div > .description-3_Ncsb { [class^="vertical-"] > div[style="display: flex; justify-content: space-between;"] > div > [class^="description-"] {
white-space: pre-wrap; white-space: pre-wrap;
overflow-wrap: anywhere; overflow-wrap: anywhere;
} }
@ -44,11 +44,8 @@ document.body.appendChild(el);
const injectGMSettings = async () => { const injectGMSettings = async () => {
const sleep = (ms) => new Promise((res) => setTimeout(res, ms)); const sleep = (ms) => new Promise((res) => setTimeout(res, ms));
while (!window.goosemod) { await sleep(3000);
await sleep(100); if (!window.goosemod) return;
}
await sleep(1000); // Wait for init / etc
goosemod.settings.items.unshift( goosemod.settings.items.unshift(
['item', 'OpenAsar', ['', ['item', 'OpenAsar', ['',