mirror of
https://github.com/gorhill/uBlock.git
synced 2024-10-06 09:37:12 +02:00
reportedly this fixes #948
This commit is contained in:
parent
0f7dc32a5e
commit
c4e3e1e8e5
@ -2240,10 +2240,7 @@ vAPI.net.registerListeners = function() {
|
|||||||
var browser = e.target;
|
var browser = e.target;
|
||||||
|
|
||||||
// I have seen this happens (at startup time)
|
// I have seen this happens (at startup time)
|
||||||
// https://github.com/gorhill/uBlock/issues/948
|
if ( !browser.currentURI ) {
|
||||||
// On older version of Firefox, `browser.webNavigation` can be null,
|
|
||||||
// which would cause currentURI to fail.
|
|
||||||
if ( !browser.webNavigation || !browser.currentURI ) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3278,7 +3275,19 @@ var optionsObserver = {
|
|||||||
cleanupTasks.push(this.unregister.bind(this));
|
cleanupTasks.push(this.unregister.bind(this));
|
||||||
|
|
||||||
var browser = tabWatcher.currentBrowser();
|
var browser = tabWatcher.currentBrowser();
|
||||||
if ( browser && browser.currentURI && browser.currentURI.spec === 'about:addons' ) {
|
if ( !browser ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// https://github.com/gorhill/uBlock/issues/948
|
||||||
|
// Older versions of Firefox can throw here when looking up `currentURI`.
|
||||||
|
var currentURI;
|
||||||
|
try {
|
||||||
|
currentURI = browser.currentURI;
|
||||||
|
} catch (ex) {
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( currentURI && currentURI.spec === 'about:addons' ) {
|
||||||
this.observe(browser.contentDocument, 'addon-enabled', this.addonId);
|
this.observe(browser.contentDocument, 'addon-enabled', this.addonId);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user