Index: lib/ui.js |
=================================================================== |
--- a/lib/ui.js |
+++ b/lib/ui.js |
@@ -33,15 +33,6 @@ |
let {initAntiAdblockNotification} = require("antiadblockInit"); |
let CustomizableUI; |
-try |
-{ |
- ({CustomizableUI}) = Cu.import("resource:///modules/CustomizableUI.jsm", null); |
-} |
-catch (e) |
-{ |
- // No built-in CustomizableUI API, use our own implementation. |
- ({CustomizableUI}) = require("customizableUI"); |
-} |
/** |
* Filter corresponding with "disable on site" menu item (set in fillIconMent()). |
@@ -148,12 +139,15 @@ |
this.value = UI.toggleSync(); |
}); |
- setChecked("adblockplus-showintoolbar", UI.isToolbarIconVisible()); |
- addCommandHandler("adblockplus-showintoolbar", function() |
+ if (hasToolbar) |
{ |
- UI.toggleToolbarIcon(); |
- this.value = UI.isToolbarIconVisible(); |
- }); |
+ setChecked("adblockplus-showintoolbar", UI.isToolbarIconVisible()); |
+ addCommandHandler("adblockplus-showintoolbar", function() |
+ { |
+ UI.toggleToolbarIcon(); |
+ this.value = UI.isToolbarIconVisible(); |
+ }); |
+ } |
Wladimir Palant
2014/04/25 14:32:19
Same change would have to be done in fillIconMenu(
saroyanm
2014/04/25 15:10:22
Good point, thanks.
|
let list = doc.getElementById("adblockplus-subscription-list"); |
if (list) |
@@ -412,6 +406,16 @@ |
let {defaultToolbarPosition} = require("appSupport"); |
if ("abp-toolbarbutton" in this.overlay && defaultToolbarPosition) |
{ |
+ try |
+ { |
+ ({CustomizableUI}) = Cu.import("resource:///modules/CustomizableUI.jsm", null); |
+ } |
+ catch (e) |
+ { |
+ // No built-in CustomizableUI API, use our own implementation. |
+ ({CustomizableUI}) = require("customizableUI"); |
+ } |
+ |
CustomizableUI.createWidget({ |
id: "abp-toolbarbutton", |
type: "custom", |