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

Firefox: update buttons when addon is enabled

This commit is contained in:
Deathamns 2015-03-15 17:49:36 +01:00 committed by gorhill
parent 2643125f66
commit 0124096789

View file

@ -1842,9 +1842,17 @@ vAPI.contextMenu.create = function(details, callback) {
/******************************************************************************/
var optionsObserver = {
addonId: '{2b10c1c8-a11f-4bad-fe9c-1c11e82cac42}',
register: function() {
Services.obs.addObserver(this, 'addon-options-displayed', false);
cleanupTasks.push(this.unregister.bind(this));
var browser = getBrowserForTab(vAPI.tabs.get(null));
if ( browser.currentURI.spec !== 'about:addons' ) {
return;
}
this.observe(browser.contentDocument, 'addon-enabled', this.addonId);
},
unregister: function() {
@ -1859,8 +1867,8 @@ var optionsObserver = {
button.label = vAPI.i18n(id);
},
observe: function(doc, topic, extensionId) {
if ( extensionId !== '{2b10c1c8-a11f-4bad-fe9c-1c11e82cac42}' ) {
observe: function(doc, topic, addonId) {
if ( addonId !== this.addonId ) {
return;
}