1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-07-03 02:37:21 +02:00

#1514: code review

This commit is contained in:
gorhill 2016-04-01 20:53:38 -04:00
parent aed185ba3f
commit baed91e111

View File

@ -31,23 +31,29 @@
null
);
if ( !this.docShell ) {
return;
}
let webProgress = this.docShell
.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIWebProgress);
if ( !webProgress ) {
return;
}
// https://github.com/gorhill/uBlock/issues/1514
// Fix?
let domWindow = webProgress.DOMWindow;
if ( domWindow !== domWindow.top ) {
return;
}
// https://github.com/gorhill/uBlock/issues/1444
// Apparently, on older versions of Firefox (31 and less), the same context
// is used for all extensions, hence we must use a unique variable name to
// ensure no collision.
this.ublock0LocationChangeListener = null;
// https://github.com/gorhill/uBlock/issues/1514
// Fix?
if ( this.docShell ) {
let webProgress = this.docShell
.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIWebProgress);
let domWindow = webProgress.DOMWindow;
if ( domWindow === domWindow.top ) {
this.ublock0LocationChangeListener = new LocationChangeListener(this.docShell, webProgress);
}
}
this.ublock0LocationChangeListener = new LocationChangeListener(this.docShell, webProgress);
}).call(this);
/******************************************************************************/