From d076a517ba97da60791ded641a7952a784203d59 Mon Sep 17 00:00:00 2001 From: hackademix Date: Fri, 1 Feb 2019 00:14:50 +0100 Subject: Generic shims for Chromium derivatives. --- src/ui/options.html | 2 ++ src/ui/popup.html | 2 ++ src/ui/prompt.html | 2 ++ src/ui/siteInfo.html | 2 ++ 4 files changed, 8 insertions(+) (limited to 'src/ui') diff --git a/src/ui/options.html b/src/ui/options.html index 6e2ad0e..4d44d75 100644 --- a/src/ui/options.html +++ b/src/ui/options.html @@ -8,6 +8,8 @@ + + diff --git a/src/ui/popup.html b/src/ui/popup.html index 517b233..5efc9e9 100644 --- a/src/ui/popup.html +++ b/src/ui/popup.html @@ -6,6 +6,8 @@ NoScript Settings + + diff --git a/src/ui/prompt.html b/src/ui/prompt.html index 902b375..3c723e5 100644 --- a/src/ui/prompt.html +++ b/src/ui/prompt.html @@ -5,6 +5,8 @@ + + diff --git a/src/ui/siteInfo.html b/src/ui/siteInfo.html index 0cb24ec..c37fb53 100644 --- a/src/ui/siteInfo.html +++ b/src/ui/siteInfo.html @@ -1,5 +1,7 @@ + + -- cgit v1.2.3 From 781514cfb946fb49bc1e2c52f16f808f26856f41 Mon Sep 17 00:00:00 2001 From: hackademix Date: Fri, 1 Feb 2019 00:28:33 +0100 Subject: Graceful degradation for missing WebExtensions APIs on Chromium. --- src/ui/Prompts.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/ui') diff --git a/src/ui/Prompts.js b/src/ui/Prompts.js index 03ea9ee..ed83ac2 100644 --- a/src/ui/Prompts.js +++ b/src/ui/Prompts.js @@ -7,14 +7,16 @@ var Prompts = (() => { async open(data) { promptData = data; this.close(); - this.currentWindow = await browser.windows.create({ + let options = { url: browser.extension.getURL("ui/prompt.html"), type: "panel", - allowScriptsToClose: true, - // titlePreface: "NoScript ", width: data.features.width, height: data.features.height, - }); + }; + if (UA.isMozilla) { + options.allowScriptsToClose = true; + } + this.currentWindow = await browser.windows.create(options); } async close() { if (this.currentWindow) { -- cgit v1.2.3 From 9b5bd1c7756c37e6760a89b444110cf9352b14fd Mon Sep 17 00:00:00 2001 From: hackademix Date: Fri, 1 Feb 2019 00:31:43 +0100 Subject: Chromium-compatible UI stylesheets. --- src/ui/popup.css | 4 +++- src/ui/ui-hc.css | 4 ++++ src/ui/ui.css | 11 +++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) (limited to 'src/ui') diff --git a/src/ui/popup.css b/src/ui/popup.css index ad5e3d0..a0febc6 100644 --- a/src/ui/popup.css +++ b/src/ui/popup.css @@ -16,6 +16,7 @@ body { #top a { appearance: none !important; + webkit-appearance: none !important; -moz-appearance: none !important; width: 2em; height: 2em; @@ -119,8 +120,9 @@ body { } .hider-close { - -moz-appearance: none; appearance: none; + -webkit-appearance: none; + -moz-appearance: none; color: black; background: transparent; padding: 0; diff --git a/src/ui/ui-hc.css b/src/ui/ui-hc.css index e1c1944..eaa5914 100644 --- a/src/ui/ui-hc.css +++ b/src/ui/ui-hc.css @@ -5,10 +5,14 @@ input { } input[type="radio"] { + appearance: radio !important; + -webkit-appearance: radio !important; -moz-appearance: radio !important; padding-right: .2em !important; } input[type="checkbox"] { + appearance: checkbox !important; + -webkit-appearance: checkbox !important; -moz-appearance: checkbox !important; } diff --git a/src/ui/ui.css b/src/ui/ui.css index f59646a..1d40030 100644 --- a/src/ui/ui.css +++ b/src/ui/ui.css @@ -3,6 +3,7 @@ body { font-family: sans-serif; font: -moz-use-system-font; font-size: 12px; + min-width: 600px; } .mobile > body { @@ -139,6 +140,8 @@ input[type="checkbox"] { input.https-only { font-size: 1em; + appearance: none; + -webkit-appearance: none; -moz-appearance: none; background: url(/img/ui-http64.png) no-repeat center; background-size: 1.5em; @@ -186,6 +189,8 @@ span.preset { .presets input.preset { font-size: 1em; + appearance: none; + -webkit-appearance: none; -moz-appearance: none; background: url(/img/ui-no64.png) no-repeat center left; background-size: 1.5em; @@ -264,6 +269,8 @@ input.preset:active, input.preset:focus, input.preset:hover { } button.options { + appearance: none; + -webkit-appearance: none; -moz-appearance: none; border: none; background: none transparent; @@ -276,6 +283,8 @@ button.options { } .preset .options { + appearance: none; + -webkit-appearance: none; -moz-appearance: none; border: 0; @@ -315,6 +324,8 @@ input.preset[value="CUSTOM"] { input.temp { font-size: 1em; + appearance: none; + -webkit-appearance: none; -moz-appearance: none; margin: 0; padding: 0; -- cgit v1.2.3 From 20b689d015ea5743099bdafcac0c6ca6519c22db Mon Sep 17 00:00:00 2001 From: hackademix Date: Fri, 1 Feb 2019 01:16:33 +0100 Subject: Fallback XSS filtering to XSS Auditor since asynchronous webRequest handlers are not supported by Chromium. --- src/ui/options.css | 8 ++++++++ src/ui/options.html | 2 +- src/ui/options.js | 6 +++--- 3 files changed, 12 insertions(+), 4 deletions(-) (limited to 'src/ui') diff --git a/src/ui/options.css b/src/ui/options.css index f7db24b..9230eb1 100644 --- a/src/ui/options.css +++ b/src/ui/options.css @@ -185,3 +185,11 @@ input[type="file"] { border-radius: .2em .2em 0 0; padding: .2em .4em; } + +#xss-opt-group { + display: none; +} + +.mozwebext #xss-opt-group { + display: block; +} diff --git a/src/ui/options.html b/src/ui/options.html index 4d44d75..5198795 100644 --- a/src/ui/options.html +++ b/src/ui/options.html @@ -101,7 +101,7 @@

-
+
(__MSG_XssFaq__) diff --git a/src/ui/options.js b/src/ui/options.js index 31cf5c3..a3f7fe8 100644 --- a/src/ui/options.js +++ b/src/ui/options.js @@ -8,9 +8,9 @@ let version = browser.runtime.getManifest().version; document.querySelector("#version").textContent = _("Version", version); // simple general options - + let opt = UI.wireOption; - + opt("global", o => { if (o) { policy.enforced = !o.checked; @@ -96,7 +96,7 @@ } let button = document.querySelector("#btn-delete-xss-choices"); let choices = UI.xssUserChoices; - button.disabled = Object.keys(choices).length === 0; + button.disabled = !choices || Object.keys(choices).length === 0; button.onclick = () => { UI.updateSettings({ xssUserChoices: {} -- cgit v1.2.3 From 0878ad2b0a0d3af5db66cc6a4f7d882e17a13365 Mon Sep 17 00:00:00 2001 From: hackademix Date: Fri, 1 Feb 2019 01:17:58 +0100 Subject: Remove usage of non-standard Array methods. --- src/ui/toolbar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ui') diff --git a/src/ui/toolbar.js b/src/ui/toolbar.js index d2a2f6e..df3515e 100644 --- a/src/ui/toolbar.js +++ b/src/ui/toolbar.js @@ -87,7 +87,7 @@ } UI.local.toolbarLayout = { left, right, - hidden: Array.map(document.querySelectorAll("#top > .hider > .icon"), el => el.id), + hidden: Array.from(document.querySelectorAll("#top > .hider > .icon")).map(el => el.id), }; debug("%o", UI.local); -- cgit v1.2.3