diff options
Diffstat (limited to 'src/bg')
-rw-r--r-- | src/bg/ChildPolicies.js | 2 | ||||
-rw-r--r-- | src/bg/RequestGuard.js | 4 | ||||
-rw-r--r-- | src/bg/Settings.js | 6 |
3 files changed, 10 insertions, 2 deletions
diff --git a/src/bg/ChildPolicies.js b/src/bg/ChildPolicies.js index 99402ca..e8608ad 100644 --- a/src/bg/ChildPolicies.js +++ b/src/bg/ChildPolicies.js @@ -102,7 +102,7 @@ let preamble = info ? `${marker} + ${JSON.stringify(JSON.stringify([info]))} + ${marker} + "," + ` : ""; await browser.tabs.executeScript(tabId, { code: `window.name = ${preamble}window.name.split(${marker} + ",").pop();`, - allFrames: false, + allFrames: true, matchAboutBlank: true, runAt: "document_start", }); diff --git a/src/bg/RequestGuard.js b/src/bg/RequestGuard.js index 299e1a3..8850542 100644 --- a/src/bg/RequestGuard.js +++ b/src/bg/RequestGuard.js @@ -317,6 +317,10 @@ var RequestGuard = (() => { await ChildPolicies.update(policy); } capabilities = perms.capabilities; + } else { + if (!isMainFrame && type === "sub_frame") { + await Settings.enforceTabRestrictions(tabId); + } } if (isMainFrame && !TabStatus.map.has(tabId)) { debug("No TabStatus data yet for noscriptFrame", tabId); diff --git a/src/bg/Settings.js b/src/bg/Settings.js index 56c88f4..a5fca55 100644 --- a/src/bg/Settings.js +++ b/src/bg/Settings.js @@ -90,7 +90,7 @@ var Settings = { if (typeof unrestrictedTab === "boolean") { ns.unrestrictedTabs[unrestrictedTab ? "add" : "delete"](tabId); - ChildPolicies.storeTabInfo(tabId, unrestrictedTab && {unrestricted: true}); + this.enforceTabRestrictions(tabId, unrestrictedTab); } if (reloadAffected) { browser.tabs.reload(tabId); @@ -123,4 +123,8 @@ var Settings = { }, null, 2); }, + async enforceTabRestrictions(tabId, unrestricted = ns.unrestrictedTabs.has(tabId)) { + await ChildPolicies.storeTabInfo(tabId, unrestricted && {unrestricted: true}); + return unrestricted; + } } |