mirror of
https://github.com/gorhill/uBlock.git
synced 2024-10-06 09:37:12 +02:00
style
This commit is contained in:
parent
facef0dc05
commit
d9bb34102f
@ -31,7 +31,7 @@ const {XPCOMUtils} = Cu.import('resource://gre/modules/XPCOMUtils.jsm', null);
|
|||||||
|
|
||||||
const hostName = Services.io.newURI(Components.stack.filename, null, null).host;
|
const hostName = Services.io.newURI(Components.stack.filename, null, null).host;
|
||||||
|
|
||||||
// Cu.import('resource://gre/modules/devtools/Console.jsm');
|
//Cu.import('resource://gre/modules/devtools/Console.jsm');
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
@ -316,19 +316,25 @@ const contentObserver = {
|
|||||||
const locationChangedMessageName = hostName + ':locationChanged';
|
const locationChangedMessageName = hostName + ':locationChanged';
|
||||||
|
|
||||||
const LocationChangeListener = function(docShell) {
|
const LocationChangeListener = function(docShell) {
|
||||||
if (docShell) {
|
if ( !docShell ) {
|
||||||
docShell.QueryInterface(Ci.nsIInterfaceRequestor);
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.docShell = docShell.getInterface(Ci.nsIWebProgress);
|
var requestor = docShell.QueryInterface(Ci.nsIInterfaceRequestor);
|
||||||
this.messageManager = docShell.getInterface(Ci.nsIContentFrameMessageManager);
|
var ds = requestor.getInterface(Ci.nsIWebProgress);
|
||||||
|
var mm = requestor.getInterface(Ci.nsIContentFrameMessageManager);
|
||||||
|
|
||||||
if (this.messageManager && typeof this.messageManager.sendAsyncMessage === 'function') {
|
if ( ds && mm && typeof mm.sendAsyncMessage === 'function' ) {
|
||||||
this.docShell.addProgressListener(this, Ci.nsIWebProgress.NOTIFY_LOCATION);
|
this.docShell = ds;
|
||||||
}
|
this.messageManager = mm;
|
||||||
|
ds.addProgressListener(this, Ci.nsIWebProgress.NOTIFY_LOCATION);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
LocationChangeListener.prototype.QueryInterface = XPCOMUtils.generateQI(["nsIWebProgressListener", "nsISupportsWeakReference"]);
|
LocationChangeListener.prototype.QueryInterface = XPCOMUtils.generateQI([
|
||||||
|
'nsIWebProgressListener',
|
||||||
|
'nsISupportsWeakReference'
|
||||||
|
]);
|
||||||
|
|
||||||
LocationChangeListener.prototype.onLocationChange = function(webProgress, request, location, flags) {
|
LocationChangeListener.prototype.onLocationChange = function(webProgress, request, location, flags) {
|
||||||
if ( !webProgress.isTopLevel ) {
|
if ( !webProgress.isTopLevel ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user