diff options
author | hackademix | 2018-10-12 22:35:46 +0200 |
---|---|---|
committer | hackademix | 2018-10-12 22:35:46 +0200 |
commit | e44fce3ebd6c348b9e09304d8b79e90f3867bd60 (patch) | |
tree | a98560cb9dff00a5204cd4f39f319bfca8596aa1 /src | |
parent | 9228798daa13086075907772e424892a9744f3d5 (diff) | |
download | noscript-e44fce3ebd6c348b9e09304d8b79e90f3867bd60.tar.gz noscript-e44fce3ebd6c348b9e09304d8b79e90f3867bd60.tar.xz noscript-e44fce3ebd6c348b9e09304d8b79e90f3867bd60.zip |
Set tab restrictions status across all frames.
Diffstat (limited to 'src')
-rw-r--r-- | src/bg/RequestGuard.js | 2 | ||||
-rw-r--r-- | src/content/staticNS.js | 14 |
2 files changed, 6 insertions, 10 deletions
diff --git a/src/bg/RequestGuard.js b/src/bg/RequestGuard.js index 8850542..436d043 100644 --- a/src/bg/RequestGuard.js +++ b/src/bg/RequestGuard.js @@ -318,7 +318,7 @@ var RequestGuard = (() => { } capabilities = perms.capabilities; } else { - if (!isMainFrame && type === "sub_frame") { + if (isMainFrame || type === "sub_frame") { await Settings.enforceTabRestrictions(tabId); } } diff --git a/src/content/staticNS.js b/src/content/staticNS.js index 4e192b8..429814c 100644 --- a/src/content/staticNS.js +++ b/src/content/staticNS.js @@ -52,15 +52,12 @@ // mess with it, though, so we wrap it around auto-hiding accessors if (this.config.MARKER = MARKER) { + let splitter = `${MARKER},`; + this.getWindowName = () => window.name.split(splitter).pop(); let tabInfoRx = new RegExp(`^${MARKER}\\[([^]*?)\\]${MARKER},`); - let name = window.name; - try { - name = top.name; - } catch(e) { - // won't work cross-origin - } - let tabInfoMatch = name.match(tabInfoRx); + + let tabInfoMatch = window.name.match(tabInfoRx); if (tabInfoMatch) { try { this.config.tabInfo = JSON.parse(tabInfoMatch[1]); @@ -68,8 +65,7 @@ error(e); } } - let splitter = `${MARKER},`; - this.getWindowName = () => window.name.split(splitter).pop(); + Reflect.defineProperty(window.wrappedJSObject, "name", { get: exportFunction(() => this.getWindowName(), window.wrappedJSObject), set: exportFunction(value => { |