From b2413f595ac73a760cb10802ae6ff2caf7851351 Mon Sep 17 00:00:00 2001 From: Oj Date: Sat, 18 Dec 2021 18:48:04 +0000 Subject: [PATCH] [MainWindow] Rewrite settings inject --- src/mainWindowInject.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/mainWindowInject.js b/src/mainWindowInject.js index 82b844f..cdbf452 100644 --- a/src/mainWindowInject.js +++ b/src/mainWindowInject.js @@ -12,15 +12,18 @@ const update = async () => { }; setInterval(update, 5000); -const settingsInject = async () => { - const infoEl = document.querySelector('.info-1VyQPT'); - if (!infoEl || document.getElementById('openasar-version')) return; +const css = ` +.socialLinks-3jqNFy + .info-1VyQPT .colorMuted-HdFt4q:nth-child(2)::after { + content: " | OpenAsar "; + display: inline; + text-transform: none; +} - const el = document.createElement('el'); - el.id = 'openasar-version'; - el.className = 'colorMuted-HdFt4q size12-3cLvbJ line-3ColD0 versionHash-2gXjIB'; - el.textContent = 'OpenAsar ()'; +.socialLinks-3jqNFy + .info-1VyQPT { + padding-right: 0; +} +`; - infoEl.appendChild(el); -}; -setInterval(settingsInject, 1000); \ No newline at end of file +const el = document.createElement('style'); +el.appendChild(document.createTextNode(css)); +document.body.appendChild(el); \ No newline at end of file