diff options
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/options.css | 10 | ||||
-rw-r--r-- | src/ui/options.html | 22 | ||||
-rw-r--r-- | src/ui/options.js | 9 | ||||
-rw-r--r-- | src/ui/ui.js | 3 |
4 files changed, 39 insertions, 5 deletions
diff --git a/src/ui/options.css b/src/ui/options.css index f7db24b..6e6eec7 100644 --- a/src/ui/options.css +++ b/src/ui/options.css @@ -136,9 +136,19 @@ input[type="file"] { .opt-group { padding: 0.5em 0; } + #xssFaq { padding: 0.5em 1em; } + +#tb-options { + display: none; +} + +.tor #tb-options { + display: initial; +} + #clearclick-options { display: none; } diff --git a/src/ui/options.html b/src/ui/options.html index 6e2ad0e..a80dece 100644 --- a/src/ui/options.html +++ b/src/ui/options.html @@ -99,17 +99,33 @@ <h3 class="flextabs__tab"><button class="flextabs__toggle">__MSG_SectionAdvanced__</button></h3> <div class="flextabs__content"> - <div class="opt-group"> - <span id="xss-opts"> + <div id="xss-options" class="opt-group"> + <span id="xss-opt"> <input type="checkbox" id="opt-xss"><label for="opt-xss" id="lbl-xss">__MSG_OptFilterXGet__</label> - <span id="xssFaq">(<a href="https://noscript.net/faq#xss" title="https://noscript.net/faq#xss">__MSG_XssFaq__</a>)</span> + <span id="xssFaq">(<a href="https://noscript.net/faq#xss" title="https://noscript.net/faq#xss">__MSG_XssFaq__</a>)</span> </span> <button id="btn-delete-xss-choices" disabled>__MSG_XSS_clearUserChoices__</button> + <br /> + <span id="xssScanRequestBody-opt"> + <input type="checkbox" id="opt-xssScanRequestBody"> + <label for="opt-xssScanRequestBody" id="lbl-opt-xssScanRequestBody">__MSG_OptScanXUpload__</label> + </span> + <span id="xssBlockUnscannedPOST-opt"> + <input type="checkbox" id="opt-xssBlockUnscannedPOST"> + <label for="opt-xssBlockUnscannedPOST" id="lbl-opt-xssBlockUnscannedPOST">__MSG_OptBlockUnscannedXPost__</label> + </span> </div> <div id="clearclick-options" class="opt-group"> <input type="checkbox" id="opt-clearclick"><label for="opt-clearclick" id="lbl-clearclick">ClearClick</label> </div> + <div id="tb-options" class="opt-group"> + <span id="overrideTorBrowserPolicy-opt"> + <input type="checkbox" id="opt-overrideTorBrowserPolicy"> + <label for="opt-overrideTorBrowserPolicy" id="lbl-opt-overrideTorBrowserPolicy">__MSG_OptOverrideTorBrowserPolicy__</label> + </span> + </div> + <section id="debug" class="browser-style"> <div class="opt-group"> <span><input type="checkbox" id="opt-debug"><label id="label-debug" for="opt-debug">Debug</label></span> diff --git a/src/ui/options.js b/src/ui/options.js index 31cf5c3..7a9ca2b 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; @@ -33,6 +33,11 @@ }); opt("xss"); + opt("xssScanRequestBody"); + opt("xssBlockUnscannedPOST"); + + opt("overrideTorBrowserPolicy"); + { let button = document.querySelector("#btn-reset"); button.onclick = async () => { diff --git a/src/ui/ui.js b/src/ui/ui.js index 205d2a9..46d9d7f 100644 --- a/src/ui/ui.js +++ b/src/ui/ui.js @@ -41,6 +41,9 @@ var UI = (() => { if (UI.local && !UI.local.debug) { debug = () => {}; // be quiet! } + if (UI.local) { + document.documentElement.classList.toggle("tor", !!UI.local.isTorBrowser); + } resolve(); if (UI.onSettings) UI.onSettings(); await HighContrast.init(); |