mirror of
https://github.com/gorhill/uBlock.git
synced 2024-10-06 09:37:12 +02:00
code review
This commit is contained in:
parent
c285ace7d8
commit
c73704ba48
@ -218,7 +218,13 @@ const contentObserver = {
|
|||||||
});
|
});
|
||||||
|
|
||||||
sandbox.injectScript = function(script) {
|
sandbox.injectScript = function(script) {
|
||||||
Services.scriptloader.loadSubScript(script, sandbox);
|
if ( Services !== undefined ) {
|
||||||
|
Services.scriptloader.loadSubScript(script, sandbox);
|
||||||
|
} else {
|
||||||
|
// Sandbox appears void.
|
||||||
|
// I've seen this happens, need to investigate why.
|
||||||
|
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -358,7 +364,6 @@ LocationChangeListener.prototype.onLocationChange = function(webProgress, reques
|
|||||||
if ( !webProgress.isTopLevel ) {
|
if ( !webProgress.isTopLevel ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.messageManager.sendAsyncMessage(locationChangedMessageName, {
|
this.messageManager.sendAsyncMessage(locationChangedMessageName, {
|
||||||
url: location.asciiSpec,
|
url: location.asciiSpec,
|
||||||
flags: flags,
|
flags: flags,
|
||||||
|
@ -56,7 +56,16 @@ let onLoadCompleted = function() {
|
|||||||
|
|
||||||
addMessageListener('ublock-load-completed', onLoadCompleted);
|
addMessageListener('ublock-load-completed', onLoadCompleted);
|
||||||
|
|
||||||
locationChangeListener = new LocationChangeListener(docShell);
|
if ( docShell ) {
|
||||||
|
let Ci = Components.interfaces;
|
||||||
|
let wp = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||||
|
.getInterface(Ci.nsIWebProgress);
|
||||||
|
let dw = wp.DOMWindow;
|
||||||
|
|
||||||
|
if ( dw === dw.top ) {
|
||||||
|
locationChangeListener = new LocationChangeListener(docShell);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user