prevent possible double faking

This commit is contained in:
kkapsner 2018-01-03 10:59:56 +01:00
parent 575df224ae
commit 66336d1b65
2 changed files with 11 additions and 1 deletions

View File

@ -159,6 +159,7 @@
}
};
let extensionID = browser.extension.getURL("");
scope.intercept = function intercept({subject: window}, {check, checkStack, ask, notify, prefs}){
var siteStatus = check({url: getURL(window)});
logging.verbose("status for page", window, siteStatus);
@ -189,6 +190,15 @@
return undef;
}
var error = new Error();
try {
// return original if the extension itself requested the function
if (error.stack.split("\n", 3)[1].split("@", 2)[1].startsWith(extensionID)){
return original;
}
}
catch (e) {
// stack had an unknown form
}
if (checkStack(error.stack)){
return original;
}

View File

@ -6,7 +6,7 @@ Version 0.4.5:
-
fixes:
-
- prevent possible double faking
Version 0.4.4b:
known issues: