[MainWindow] Rewrite settings inject

This commit is contained in:
Ducko 2021-12-18 18:48:04 +00:00
parent 33aeadc4c2
commit b2413f595a

View file

@ -12,15 +12,18 @@ const update = async () => {
}; };
setInterval(update, 5000); setInterval(update, 5000);
const settingsInject = async () => { const css = `
const infoEl = document.querySelector('.info-1VyQPT'); .socialLinks-3jqNFy + .info-1VyQPT .colorMuted-HdFt4q:nth-child(2)::after {
if (!infoEl || document.getElementById('openasar-version')) return; content: " | OpenAsar <version_2>";
display: inline;
text-transform: none;
}
const el = document.createElement('el'); .socialLinks-3jqNFy + .info-1VyQPT {
el.id = 'openasar-version'; padding-right: 0;
el.className = 'colorMuted-HdFt4q size12-3cLvbJ line-3ColD0 versionHash-2gXjIB'; }
el.textContent = 'OpenAsar <version_1> (<version_2>)'; `;
infoEl.appendChild(el); const el = document.createElement('style');
}; el.appendChild(document.createTextNode(css));
setInterval(settingsInject, 1000); document.body.appendChild(el);