diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-08 00:14:08 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-08 00:14:08 +0200 |
commit | 7b9b08e2071331738ae1dde7a7efd8c145448b90 (patch) | |
tree | 4d958b841c34c0d0c6bb6c6958a75d6a3634ec67 /devtools/client/framework/devtools-browser.js | |
parent | fdb5aba59a7851e24ef08a5d6668fdc3e6516ee9 (diff) | |
download | UXP-7b9b08e2071331738ae1dde7a7efd8c145448b90.tar UXP-7b9b08e2071331738ae1dde7a7efd8c145448b90.tar.gz UXP-7b9b08e2071331738ae1dde7a7efd8c145448b90.tar.lz UXP-7b9b08e2071331738ae1dde7a7efd8c145448b90.tar.xz UXP-7b9b08e2071331738ae1dde7a7efd8c145448b90.zip |
CustomizableUI.jsm can't be used for Pale Moon - setting conditions
Issue #97
Diffstat (limited to 'devtools/client/framework/devtools-browser.js')
-rw-r--r-- | devtools/client/framework/devtools-browser.js | 19 |
1 files changed, 17 insertions, 2 deletions
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); }, |