From c0956b20b90e5b57ead30c783c5b102408a1190a Mon Sep 17 00:00:00 2001 From: hackademix Date: Thu, 27 Dec 2018 10:53:53 +0100 Subject: Safer cookie-less check for unrestricted tabs from subdocuments. --- src/content/staticNS.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src') 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); + } } } } -- cgit v1.2.3