mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-09 17:31:47 +09:00
(from Waterfox Classic) Refactor addonId access in BasePrincipal and related files
This commit is contained in:
parent
ef314d225f
commit
203d58a5cd
6 changed files with 26 additions and 13 deletions
|
|
@ -309,7 +309,15 @@ WebExtensionActor.prototype._shouldAddNewGlobalAsDebuggee = function (newGlobal)
|
|||
const global = unwrapDebuggerObjectGlobal(newGlobal);
|
||||
|
||||
if (global instanceof Ci.nsIDOMWindow) {
|
||||
return global.document.nodePrincipal.originAttributes.addonId == this.id;
|
||||
try {
|
||||
global.document;
|
||||
} catch (e) {
|
||||
// Sandboxes can expose a window in their prototype chain without
|
||||
// having permission to access their own proto after navigation.
|
||||
return false;
|
||||
}
|
||||
|
||||
return global.document.nodePrincipal.addonId == this.id;
|
||||
}
|
||||
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue