From 7b9b08e2071331738ae1dde7a7efd8c145448b90 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Sun, 8 Apr 2018 00:14:08 +0200 Subject: CustomizableUI.jsm can't be used for Pale Moon - setting conditions Issue #97 --- devtools/client/framework/devtools-browser.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'devtools/client') diff --git a/devtools/client/framework/devtools-browser.js b/devtools/client/framework/devtools-browser.js index b9f4d92ba..5193592dd 100644 --- a/devtools/client/framework/devtools-browser.js +++ b/devtools/client/framework/devtools-browser.js @@ -27,9 +27,12 @@ loader.lazyRequireGetter(this, "DebuggerServer", "devtools/server/main", true); loader.lazyRequireGetter(this, "DebuggerClient", "devtools/shared/client/main", true); loader.lazyRequireGetter(this, "BrowserMenus", "devtools/client/framework/browser-menus"); -loader.lazyImporter(this, "CustomizableUI", "resource:///modules/CustomizableUI.jsm"); loader.lazyImporter(this, "AppConstants", "resource://gre/modules/AppConstants.jsm"); +if (AppConstants.MOZ_APP_NAME.toLowerCase() != "palemoon") { + loader.lazyImporter(this, "CustomizableUI", "resource:///modules/CustomizableUI.jsm"); +} + const {LocalizationHelper} = require("devtools/shared/l10n"); const L10N = new LocalizationHelper("devtools/client/locales/toolbox.properties"); @@ -295,6 +298,9 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = { * Install Developer widget */ installDeveloperWidget: function () { + if (typeof CustomizableUI === "undefined") { + return; + } let id = "developer-button"; let widget = CustomizableUI.getWidget(id); if (widget && widget.provider == CustomizableUI.PROVIDER_API) { @@ -350,7 +356,7 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = { */ // Used by itself installWebIDEWidget: function () { - if (this.isWebIDEWidgetInstalled()) { + if ((typeof CustomizableUI === "undefined") || this.isWebIDEWidgetInstalled()) { return; } @@ -374,6 +380,9 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = { }, isWebIDEWidgetInstalled: function () { + if (typeof CustomizableUI === "undefined") { + return false; + } let widgetWrapper = CustomizableUI.getWidget("webide-button"); return !!(widgetWrapper && widgetWrapper.provider == CustomizableUI.PROVIDER_API); }, @@ -387,6 +396,9 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = { * Uninstall WebIDE widget */ uninstallWebIDEWidget: function () { + if (typeof CustomizableUI === "undefined") { + return; + } if (this.isWebIDEWidgetInstalled()) { CustomizableUI.removeWidgetFromArea("webide-button"); } @@ -398,6 +410,9 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = { */ // Used by webide.js moveWebIDEWidgetInNavbar: function () { + if (typeof CustomizableUI === "undefined") { + return; + } CustomizableUI.addWidgetToArea("webide-button", CustomizableUI.AREA_NAVBAR); }, -- cgit v1.2.3