mirror of
https://github.com/gorhill/uBlock.git
synced 2024-10-06 09:37:12 +02:00
this fixes #1459
This commit is contained in:
parent
df61d2a5e6
commit
9772e95046
@ -1970,16 +1970,20 @@ var httpObserver = {
|
|||||||
// Also:
|
// Also:
|
||||||
// https://developer.mozilla.org/en-US/Firefox/Multiprocess_Firefox/Limitations_of_chrome_scripts
|
// https://developer.mozilla.org/en-US/Firefox/Multiprocess_Firefox/Limitations_of_chrome_scripts
|
||||||
tabIdFromChannel: function(channel) {
|
tabIdFromChannel: function(channel) {
|
||||||
var ncbs = channel.notificationCallbacks;
|
|
||||||
if ( !ncbs && channel.loadGroup ) {
|
|
||||||
ncbs = channel.loadGroup.notificationCallbacks;
|
|
||||||
}
|
|
||||||
if ( !ncbs ) { return vAPI.noTabId; }
|
|
||||||
var lc;
|
var lc;
|
||||||
try {
|
try {
|
||||||
lc = ncbs.getInterface(Ci.nsILoadContext);
|
lc = channel.notificationCallbacks.getInterface(Ci.nsILoadContext);
|
||||||
} catch (ex) { }
|
} catch(ex) {
|
||||||
if ( !lc ) { return vAPI.noTabId; }
|
}
|
||||||
|
if ( !lc ) {
|
||||||
|
try {
|
||||||
|
lc = channel.loadGroup.notificationCallbacks.getInterface(Ci.nsILoadContext);
|
||||||
|
} catch(ex) {
|
||||||
|
}
|
||||||
|
if ( !lc ) {
|
||||||
|
return vAPI.noTabId;
|
||||||
|
}
|
||||||
|
}
|
||||||
if ( lc.topFrameElement ) {
|
if ( lc.topFrameElement ) {
|
||||||
return tabWatcher.tabIdFromTarget(lc.topFrameElement);
|
return tabWatcher.tabIdFromTarget(lc.topFrameElement);
|
||||||
}
|
}
|
||||||
@ -1987,7 +1991,9 @@ var httpObserver = {
|
|||||||
try {
|
try {
|
||||||
win = lc.associatedWindow;
|
win = lc.associatedWindow;
|
||||||
} catch (ex) { }
|
} catch (ex) { }
|
||||||
if ( !win ) { return vAPI.noTabId; }
|
if ( !win ) {
|
||||||
|
return vAPI.noTabId;
|
||||||
|
}
|
||||||
if ( win.top ) {
|
if ( win.top ) {
|
||||||
win = win.top;
|
win = win.top;
|
||||||
}
|
}
|
||||||
@ -1999,7 +2005,9 @@ var httpObserver = {
|
|||||||
.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindow)
|
.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindow)
|
||||||
);
|
);
|
||||||
} catch (ex) { }
|
} catch (ex) { }
|
||||||
if ( !tabBrowser ) { return vAPI.noTabId; }
|
if ( !tabBrowser ) {
|
||||||
|
return vAPI.noTabId;
|
||||||
|
}
|
||||||
if ( tabBrowser.getBrowserForContentWindow ) {
|
if ( tabBrowser.getBrowserForContentWindow ) {
|
||||||
return tabWatcher.tabIdFromTarget(tabBrowser.getBrowserForContentWindow(win));
|
return tabWatcher.tabIdFromTarget(tabBrowser.getBrowserForContentWindow(win));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user