mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-10 01:02:08 +01:00
#1514: code review
This commit is contained in:
parent
aed185ba3f
commit
baed91e111
1 changed files with 19 additions and 13 deletions
|
@ -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);
|
||||
|
||||
/******************************************************************************/
|
||||
|
|
Loading…
Reference in a new issue