Skip to content

Commit e44fce3

Browse files
committed
Set tab restrictions status across all frames.
1 parent 9228798 commit e44fce3

2 files changed

Lines changed: 6 additions & 10 deletions

File tree

src/bg/RequestGuard.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ var RequestGuard = (() => {
318318
}
319319
capabilities = perms.capabilities;
320320
} else {
321-
if (!isMainFrame && type === "sub_frame") {
321+
if (isMainFrame || type === "sub_frame") {
322322
await Settings.enforceTabRestrictions(tabId);
323323
}
324324
}

src/content/staticNS.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,24 +52,20 @@
5252
// mess with it, though, so we wrap it around auto-hiding accessors
5353

5454
if (this.config.MARKER = MARKER) {
55+
let splitter = `${MARKER},`;
56+
this.getWindowName = () => window.name.split(splitter).pop();
5557

5658
let tabInfoRx = new RegExp(`^${MARKER}\\[([^]*?)\\]${MARKER},`);
57-
let name = window.name;
58-
try {
59-
name = top.name;
60-
} catch(e) {
61-
// won't work cross-origin
62-
}
63-
let tabInfoMatch = name.match(tabInfoRx);
59+
60+
let tabInfoMatch = window.name.match(tabInfoRx);
6461
if (tabInfoMatch) {
6562
try {
6663
this.config.tabInfo = JSON.parse(tabInfoMatch[1]);
6764
} catch (e) {
6865
error(e);
6966
}
7067
}
71-
let splitter = `${MARKER},`;
72-
this.getWindowName = () => window.name.split(splitter).pop();
68+
7369
Reflect.defineProperty(window.wrappedJSObject, "name", {
7470
get: exportFunction(() => this.getWindowName(), window.wrappedJSObject),
7571
set: exportFunction(value => {

0 commit comments

Comments
 (0)