mirror of https://github.com/gorhill/uBlock.git
fix warning on older firefox versions
This commit is contained in:
parent
e4973e738b
commit
66635c44c6
|
@ -31,6 +31,8 @@ const {classes: Cc, interfaces: Ci} = Components;
|
||||||
// Accessing the context of the background page:
|
// Accessing the context of the background page:
|
||||||
// var win = Services.appShell.hiddenDOMWindow.document.querySelector('iframe[src*=ublock0]').contentWindow;
|
// var win = Services.appShell.hiddenDOMWindow.document.querySelector('iframe[src*=ublock0]').contentWindow;
|
||||||
|
|
||||||
|
let windowlessBrowser = null;
|
||||||
|
let windowlessBrowserPL = null;
|
||||||
let bgProcess = null;
|
let bgProcess = null;
|
||||||
let version;
|
let version;
|
||||||
const hostName = 'ublock0';
|
const hostName = 'ublock0';
|
||||||
|
@ -86,9 +88,6 @@ function createBgProcess(parentDocument) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
let windowlessBrowser;
|
|
||||||
let windowlessBrowserPL;
|
|
||||||
|
|
||||||
function getWindowlessBrowserFrame(appShell) {
|
function getWindowlessBrowserFrame(appShell) {
|
||||||
windowlessBrowser = appShell.createWindowlessBrowser(true);
|
windowlessBrowser = appShell.createWindowlessBrowser(true);
|
||||||
windowlessBrowser.QueryInterface(Ci.nsIInterfaceRequestor);
|
windowlessBrowser.QueryInterface(Ci.nsIInterfaceRequestor);
|
||||||
|
@ -98,7 +97,7 @@ function getWindowlessBrowserFrame(appShell) {
|
||||||
QueryInterface: XPCOMUtils.generateQI([
|
QueryInterface: XPCOMUtils.generateQI([
|
||||||
Ci.nsIWebProgressListener, Ci.nsIWebProgressListener2,
|
Ci.nsIWebProgressListener, Ci.nsIWebProgressListener2,
|
||||||
Ci.nsISupportsWeakReference]),
|
Ci.nsISupportsWeakReference]),
|
||||||
onStateChange(wbp, request, stateFlags, status) {
|
onStateChange(wbp, request, stateFlags/*, status*/) {
|
||||||
if ( !request ) {
|
if ( !request ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -189,7 +188,10 @@ function shutdown(data, reason) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( windowlessBrowser !== null ) {
|
if ( windowlessBrowser !== null ) {
|
||||||
windowlessBrowser.close();
|
// close() does not exist for older versions of Firefox.
|
||||||
|
if ( typeof windowlessBrowser.close === 'function' ) {
|
||||||
|
windowlessBrowser.close();
|
||||||
|
}
|
||||||
windowlessBrowser = null;
|
windowlessBrowser = null;
|
||||||
windowlessBrowserPL = null;
|
windowlessBrowserPL = null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue