mirror of https://github.com/gorhill/uBlock.git
style
This commit is contained in:
parent
facef0dc05
commit
d9bb34102f
|
@ -316,19 +316,25 @@ const contentObserver = {
|
|||
const locationChangedMessageName = hostName + ':locationChanged';
|
||||
|
||||
const LocationChangeListener = function(docShell) {
|
||||
if (docShell) {
|
||||
docShell.QueryInterface(Ci.nsIInterfaceRequestor);
|
||||
|
||||
this.docShell = docShell.getInterface(Ci.nsIWebProgress);
|
||||
this.messageManager = docShell.getInterface(Ci.nsIContentFrameMessageManager);
|
||||
|
||||
if (this.messageManager && typeof this.messageManager.sendAsyncMessage === 'function') {
|
||||
this.docShell.addProgressListener(this, Ci.nsIWebProgress.NOTIFY_LOCATION);
|
||||
if ( !docShell ) {
|
||||
return;
|
||||
}
|
||||
|
||||
var requestor = docShell.QueryInterface(Ci.nsIInterfaceRequestor);
|
||||
var ds = requestor.getInterface(Ci.nsIWebProgress);
|
||||
var mm = requestor.getInterface(Ci.nsIContentFrameMessageManager);
|
||||
|
||||
if ( ds && mm && typeof mm.sendAsyncMessage === 'function' ) {
|
||||
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) {
|
||||
if ( !webProgress.isTopLevel ) {
|
||||
|
|
Loading…
Reference in New Issue