diff --git a/toolkit/devtools/DevToolsUtils.js b/toolkit/devtools/DevToolsUtils.js index edec0362cbc..a9ea7077887 100644 --- a/toolkit/devtools/DevToolsUtils.js +++ b/toolkit/devtools/DevToolsUtils.js @@ -290,6 +290,12 @@ exports.hasSafeGetter = function hasSafeGetter(aDesc) { * True if it is safe to read properties from aObj, or false otherwise. */ exports.isSafeJSObject = function isSafeJSObject(aObj) { + // If we are running on a worker thread, Cu is not available. In this case, + // we always return false, just to be on the safe side. + if (!Cu) { + return false; + } + if (Cu.getGlobalForObject(aObj) == Cu.getGlobalForObject(exports.isSafeJSObject)) { return true; // aObj is not a cross-compartment wrapper. diff --git a/toolkit/devtools/worker-loader.js b/toolkit/devtools/worker-loader.js index 13b4fafc9b1..e42b4da8e2b 100644 --- a/toolkit/devtools/worker-loader.js +++ b/toolkit/devtools/worker-loader.js @@ -102,7 +102,6 @@ function createModule(id) { // // TODO: Remove this when the whitelist becomes empty let chromeWhitelist = [ - "devtools/toolkit/DevToolsUtils", "devtools/toolkit/event-emitter", ];