Backed out 3 changesets (bug 1479569) for devtools/client/responsive.html failures. CLOSED TREE
Backed out changeset e123d0aa911c (bug 1479569) Backed out changeset b828a58404e5 (bug 1479569) Backed out changeset 97041ef8f311 (bug 1479569)
This commit is contained in:
@@ -88,6 +88,16 @@ var contentScripts = new DefaultWeakMap(matcher => {
|
||||
matcher);
|
||||
});
|
||||
|
||||
function getMessageManager(window) {
|
||||
let docShell = window.docShell.QueryInterface(Ci.nsIInterfaceRequestor);
|
||||
try {
|
||||
return docShell.getInterface(Ci.nsIContentFrameMessageManager);
|
||||
} catch (e) {
|
||||
// Some windows don't support this interface (hidden window).
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
var DocumentManager;
|
||||
var ExtensionManager;
|
||||
|
||||
@@ -480,7 +490,7 @@ ExtensionProcessScript.prototype = {
|
||||
},
|
||||
|
||||
initExtensionDocument(policy, doc) {
|
||||
if (DocumentManager.globals.has(doc.defaultView.docShell.messageManager)) {
|
||||
if (DocumentManager.globals.has(getMessageManager(doc.defaultView))) {
|
||||
DocumentManager.loadInto(policy, doc.defaultView);
|
||||
}
|
||||
},
|
||||
@@ -497,7 +507,7 @@ ExtensionProcessScript.prototype = {
|
||||
},
|
||||
|
||||
loadContentScript(contentScript, window) {
|
||||
if (DocumentManager.globals.has(window.docShell.messageManager)) {
|
||||
if (DocumentManager.globals.has(getMessageManager(window))) {
|
||||
contentScripts.get(contentScript).injectInto(window);
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user