зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1378207 - Handle sandboxes with XOW protos in WebExtensionChildActor. r=rpl
Sandbox can throw on property access if it does not have permission to access its own proto, even if the caller compartment had.
This commit is contained in:
Родитель
31faf6cf36
Коммит
d624f6b97e
|
@ -336,6 +336,16 @@ WebExtensionChildActor.prototype._shouldAddNewGlobalAsDebuggee = function (newGl
|
|||
const global = unwrapDebuggerObjectGlobal(newGlobal);
|
||||
|
||||
if (global instanceof Ci.nsIDOMWindow) {
|
||||
try {
|
||||
global.document;
|
||||
} catch (e) {
|
||||
// The global might be a sandbox with a window object in its proto chain. If the
|
||||
// window navigated away since the sandbox was created, it can throw a security
|
||||
// exception during this property check as the sandbox no longer has access to
|
||||
// its own proto.
|
||||
return false;
|
||||
}
|
||||
|
||||
// Filter out any global which contains a XUL document.
|
||||
if (global.document instanceof Ci.nsIDOMXULDocument) {
|
||||
return false;
|
||||
|
|
Загрузка…
Ссылка в новой задаче