diff options
author | hackademix | 2018-12-27 10:53:53 +0100 |
---|---|---|
committer | hackademix | 2018-12-27 10:54:45 +0100 |
commit | c0956b20b90e5b57ead30c783c5b102408a1190a (patch) | |
tree | 58e9f842defb2d9ac552f0963861a20632ab6eba /src/content | |
parent | 67312d038506a14eb1d1a7c2e66e6a1f429c46d8 (diff) | |
download | noscript-c0956b20b90e5b57ead30c783c5b102408a1190a.tar.gz noscript-c0956b20b90e5b57ead30c783c5b102408a1190a.tar.xz noscript-c0956b20b90e5b57ead30c783c5b102408a1190a.zip |
Safer cookie-less check for unrestricted tabs from subdocuments.
Diffstat (limited to 'src/content')
-rw-r--r-- | src/content/staticNS.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/content/staticNS.js b/src/content/staticNS.js index 0cd254c..e169087 100644 --- a/src/content/staticNS.js +++ b/src/content/staticNS.js @@ -70,10 +70,15 @@ // or the cookie might have been deleted in a race condition, // so here we try to check the parent let checkParent = parent.wrappedJSObject.checkNoScriptUnrestricted; - if (checkParent) { - let challenge = uuid(); - let unrestricted = checkParent(challenge) === checkUnrestricted(challenge); - this.config.tabInfo = {unrestricted, inherited: true}; + if (typeof checkParent === "function") { + try { + let challenge = uuid(); + let unrestricted = checkParent(challenge) === checkUnrestricted(challenge); + this.config.tabInfo = {unrestricted, inherited: true}; + } catch (e) { + debug("Exception thrown while checking parent unrestricted tab marker. Something fishy going on...") + error(e); + } } } } |