1
0
Fork 0
mirror of https://github.com/gorhill/uMatrix.git synced 2024-06-01 10:00:10 +12:00

Firefox: check for non-existent button

This commit is contained in:
Deathamns 2015-03-18 07:04:30 +01:00 committed by gorhill
parent 28923771dc
commit e38cd3c7f1

View file

@ -1019,7 +1019,7 @@ var httpObserver = {
// Guard against stale instances not having been unregistered
if ( this.componentRegistrar.isCIDRegistered(this.classID) ) {
try {
this.componentRegistrar.unregisterFactory(this.classID, Components.manager.getClassObject(this.classID, Ci.nsIFactory))
this.componentRegistrar.unregisterFactory(this.classID, Components.manager.getClassObject(this.classID, Ci.nsIFactory));
} catch (ex) {
console.error('µBlock> httpObserver > unable to unregister stale instance: ', ex);
}
@ -1839,6 +1839,9 @@ var optionsObserver = {
setupOptionsButton: function(doc, id, page) {
var button = doc.getElementById(id);
if ( button === null ) {
return;
}
button.addEventListener('command', function() {
vAPI.tabs.open({ url: page, index: -1 });
});