mirror of
https://github.com/gorhill/uBlock.git
synced 2024-10-06 09:37:12 +02:00
Firefox: update buttons when addon is enabled
This commit is contained in:
parent
ac09dfadab
commit
90295e7bef
@ -1844,9 +1844,17 @@ vAPI.contextMenu.create = function(details, callback) {
|
|||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
var optionsObserver = {
|
var optionsObserver = {
|
||||||
|
addonId: '{2b10c1c8-a11f-4bad-fe9c-1c11e82cac42}',
|
||||||
|
|
||||||
register: function() {
|
register: function() {
|
||||||
Services.obs.addObserver(this, 'addon-options-displayed', false);
|
Services.obs.addObserver(this, 'addon-options-displayed', false);
|
||||||
cleanupTasks.push(this.unregister.bind(this));
|
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() {
|
unregister: function() {
|
||||||
@ -1861,8 +1869,8 @@ var optionsObserver = {
|
|||||||
button.label = vAPI.i18n(id);
|
button.label = vAPI.i18n(id);
|
||||||
},
|
},
|
||||||
|
|
||||||
observe: function(doc, topic, extensionId) {
|
observe: function(doc, topic, addonId) {
|
||||||
if ( extensionId !== '{2b10c1c8-a11f-4bad-fe9c-1c11e82cac42}' ) {
|
if ( addonId !== this.addonId ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user