Bug 1335807 - JavaScript Error: 'NS_NOINTERFACE: ' {file: 'resource:///modules/ContentWebRTC.jsm' line: 387}, r=felipe.

This commit is contained in:
Florian Quèze 2017-02-16 00:13:46 +01:00
Родитель 735050d760
Коммит a1b5dae154
1 изменённых файлов: 16 добавлений и 5 удалений

Просмотреть файл

@ -385,12 +385,23 @@ function getInnerWindowIDForWindow(aContentWindow) {
}
function getMessageManagerForWindow(aContentWindow) {
let ir = aContentWindow.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDocShell)
.sameTypeRootTreeItem
aContentWindow.QueryInterface(Ci.nsIInterfaceRequestor);
let docShell;
try {
// This throws NS_NOINTERFACE for closed tabs.
docShell = aContentWindow.getInterface(Ci.nsIDocShell);
} catch (e) {
if (e.result == Cr.NS_NOINTERFACE) {
return null;
}
throw e;
}
let ir = docShell.sameTypeRootTreeItem
.QueryInterface(Ci.nsIInterfaceRequestor);
try {
// If e10s is disabled, this throws NS_NOINTERFACE for closed tabs.
// This throws NS_NOINTERFACE for closed tabs (only with e10s enabled).
return ir.getInterface(Ci.nsIContentFrameMessageManager);
} catch (e) {
if (e.result == Cr.NS_NOINTERFACE) {