зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1572414 - Fix hasNativeConsoleAPI when dealing with Sandboxes. r=yulia.
When the console parent actor is a ContentProcessTargetActor, we don't have a reference to a `nsIDOMWindow`, but only to a Sandbox. The code in `hasNativeConsoleAPI` would then silently fail when trying to access `window.wrappedJSObject`, and keep `isNative` as `false`. For now, we work around this by always returning true if we don't have access to a `nsIDOMWindow`. Differential Revision: https://phabricator.services.mozilla.com/D42506 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
df1ed9b01a
Коммит
4707300839
|
@ -415,8 +415,8 @@ const WebConsoleActor = ActorClassWithSpec(webconsoleSpec, {
|
|||
},
|
||||
|
||||
hasNativeConsoleAPI: function(window) {
|
||||
if (isWorker) {
|
||||
// Can't use XPCNativeWrapper as a way to check for console API in workers
|
||||
if (isWorker || !(window instanceof Ci.nsIDOMWindow)) {
|
||||
// We can only use XPCNativeWrapper on non-worker nsIDOMWindow.
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче