Set tab restrictions status across all frames.
This commit is contained in:
parent
9228798daa
commit
e44fce3ebd
|
@ -318,7 +318,7 @@ var RequestGuard = (() => {
|
||||||
}
|
}
|
||||||
capabilities = perms.capabilities;
|
capabilities = perms.capabilities;
|
||||||
} else {
|
} else {
|
||||||
if (!isMainFrame && type === "sub_frame") {
|
if (isMainFrame || type === "sub_frame") {
|
||||||
await Settings.enforceTabRestrictions(tabId);
|
await Settings.enforceTabRestrictions(tabId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,15 +52,12 @@
|
||||||
// mess with it, though, so we wrap it around auto-hiding accessors
|
// mess with it, though, so we wrap it around auto-hiding accessors
|
||||||
|
|
||||||
if (this.config.MARKER = MARKER) {
|
if (this.config.MARKER = MARKER) {
|
||||||
|
let splitter = `${MARKER},`;
|
||||||
|
this.getWindowName = () => window.name.split(splitter).pop();
|
||||||
|
|
||||||
let tabInfoRx = new RegExp(`^${MARKER}\\[([^]*?)\\]${MARKER},`);
|
let tabInfoRx = new RegExp(`^${MARKER}\\[([^]*?)\\]${MARKER},`);
|
||||||
let name = window.name;
|
|
||||||
try {
|
let tabInfoMatch = window.name.match(tabInfoRx);
|
||||||
name = top.name;
|
|
||||||
} catch(e) {
|
|
||||||
// won't work cross-origin
|
|
||||||
}
|
|
||||||
let tabInfoMatch = name.match(tabInfoRx);
|
|
||||||
if (tabInfoMatch) {
|
if (tabInfoMatch) {
|
||||||
try {
|
try {
|
||||||
this.config.tabInfo = JSON.parse(tabInfoMatch[1]);
|
this.config.tabInfo = JSON.parse(tabInfoMatch[1]);
|
||||||
|
@ -68,8 +65,7 @@
|
||||||
error(e);
|
error(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let splitter = `${MARKER},`;
|
|
||||||
this.getWindowName = () => window.name.split(splitter).pop();
|
|
||||||
Reflect.defineProperty(window.wrappedJSObject, "name", {
|
Reflect.defineProperty(window.wrappedJSObject, "name", {
|
||||||
get: exportFunction(() => this.getWindowName(), window.wrappedJSObject),
|
get: exportFunction(() => this.getWindowName(), window.wrappedJSObject),
|
||||||
set: exportFunction(value => {
|
set: exportFunction(value => {
|
||||||
|
|
Loading…
Reference in New Issue