Fallback XSS filtering to XSS Auditor since asynchronous webRequest handlers are not supported by Chromium.

This commit is contained in:
hackademix 2019-02-01 01:16:33 +01:00
parent 2fa009673f
commit 20b689d015
4 changed files with 14 additions and 4 deletions

View File

@ -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;
}

View File

@ -101,7 +101,7 @@
<h3 class="flextabs__tab"><button class="flextabs__toggle">__MSG_SectionAdvanced__</button></h3>
<div class="flextabs__content">
<div class="opt-group">
<div class="opt-group" id="xss-opt-group">
<span id="xss-opts">
<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>

View File

@ -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: {}

View File

@ -113,6 +113,8 @@ var XSS = (() => {
return {
async start() {
if (!UA.isMozilla) return; // async webRequest is supported on Mozilla only
let {onBeforeRequest} = browser.webRequest;
if (onBeforeRequest.hasListener(requestListener)) return;