diff options
author | hackademix | 2019-02-01 01:13:26 +0100 |
---|---|---|
committer | hackademix | 2019-02-01 01:13:26 +0100 |
commit | 2fa009673f3d51b14389f8e25075de394290b32c (patch) | |
tree | 1e07f63f9f32dfa27d289b45a9f599ec3104ef0c /src/lib | |
parent | 9b5bd1c7756c37e6760a89b444110cf9352b14fd (diff) | |
download | noscript-2fa009673f3d51b14389f8e25075de394290b32c.tar.gz noscript-2fa009673f3d51b14389f8e25075de394290b32c.tar.xz noscript-2fa009673f3d51b14389f8e25075de394290b32c.zip |
Conditional CSS toggle for non-mozilla browsers.
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/UA.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lib/UA.js b/src/lib/UA.js index 0a751a4..1a1771a 100644 --- a/src/lib/UA.js +++ b/src/lib/UA.js @@ -2,7 +2,11 @@ var UA = { isMozilla: document.URL.startsWith("moz-"), } -if (!UA.isMozilla && typeof chrome === "object" && !chrome.tabs && typeof exportFunction === "undefined") { - // content script shims - window.exportFunction = () => {}; +if (!UA.isMozilla) { + if (typeof chrome === "object" && !chrome.tabs && typeof exportFunction === "undefined") { + // content script shims + window.exportFunction = () => {}; + } +} else { + document.documentElement.classList.add("mozwebext"); } |