summaryrefslogtreecommitdiffstats
path: root/toolkit/mozapps/extensions/content
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/mozapps/extensions/content')
-rw-r--r--toolkit/mozapps/extensions/content/extensions.js4
-rw-r--r--toolkit/mozapps/extensions/content/extensions.xml2
-rw-r--r--toolkit/mozapps/extensions/content/extensions.xul6
3 files changed, 12 insertions, 0 deletions
diff --git a/toolkit/mozapps/extensions/content/extensions.js b/toolkit/mozapps/extensions/content/extensions.js
index 8d9c132e6..fc4392231 100644
--- a/toolkit/mozapps/extensions/content/extensions.js
+++ b/toolkit/mozapps/extensions/content/extensions.js
@@ -18,10 +18,12 @@ Cu.import("resource://gre/modules/addons/AddonRepository.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
"resource://gre/modules/PluralForm.jsm");
+#ifdef MOZ_DEVTOOLS
XPCOMUtils.defineLazyGetter(this, "BrowserToolboxProcess", function () {
return Cu.import("resource://devtools/client/framework/ToolboxProcess.jsm", {}).
BrowserToolboxProcess;
});
+#endif
const PREF_DISCOVERURL = "extensions.webservice.discoverURL";
const PREF_DISCOVER_ENABLED = "extensions.getAddons.showPane";
@@ -1002,6 +1004,7 @@ var gViewController = {
}
},
+#ifdef MOZ_DEVTOOLS
cmd_debugItem: {
doCommand: function cmd_debugItem_doCommand(aAddon) {
BrowserToolboxProcess.init({ addonID: aAddon.id });
@@ -1015,6 +1018,7 @@ var gViewController = {
return aAddon && aAddon.isDebuggable && debuggerEnabled && remoteEnabled;
}
},
+#endif
cmd_showItemPreferences: {
isEnabled: function cmd_showItemPreferences_isEnabled(aAddon) {
diff --git a/toolkit/mozapps/extensions/content/extensions.xml b/toolkit/mozapps/extensions/content/extensions.xml
index 7fe17be2a..cbd05bfa9 100644
--- a/toolkit/mozapps/extensions/content/extensions.xml
+++ b/toolkit/mozapps/extensions/content/extensions.xml
@@ -1628,11 +1628,13 @@
]]></body>
</method>
+#ifdef MOZ_DEVTOOLS
<method name="debug">
<body><![CDATA[
gViewController.doCommand("cmd_debugItem", this.mAddon);
]]></body>
</method>
+#endif
<method name="showPreferences">
<body><![CDATA[
diff --git a/toolkit/mozapps/extensions/content/extensions.xul b/toolkit/mozapps/extensions/content/extensions.xul
index c1a8edc86..c5eeb534f 100644
--- a/toolkit/mozapps/extensions/content/extensions.xul
+++ b/toolkit/mozapps/extensions/content/extensions.xul
@@ -53,8 +53,10 @@
<menuitem id="menuitem_uninstallItem" command="cmd_uninstallItem"
label="&cmd.uninstallAddon.label;"
accesskey="&cmd.uninstallAddon.accesskey;"/>
+#ifdef MOZ_DEVTOOLS
<menuitem id="menuitem_debugItem" command="cmd_debugItem"
label="&cmd.debugAddon.label;"/>
+#endif
<menuseparator id="addonitem-menuseparator" />
<menuitem id="menuitem_preferences" command="cmd_showItemPreferences"
#ifdef XP_WIN
@@ -101,7 +103,9 @@
<command id="cmd_findItemUpdates"/>
<command id="cmd_showItemPreferences"/>
<command id="cmd_showItemAbout"/>
+#ifdef MOZ_DEVTOOLS
<command id="cmd_debugItem"/>
+#endif
<command id="cmd_enableItem"/>
<command id="cmd_disableItem"/>
<command id="cmd_installItem"/>
@@ -631,9 +635,11 @@
#endif
command="cmd_showItemPreferences"/>
<spacer flex="1"/>
+#ifdef MOZ_DEVTOOLS
<button id="detail-debug-btn" class="addon-control debug"
label="Debug"
command="cmd_debugItem" />
+#endif
<button id="detail-enable-btn" class="addon-control enable"
label="&cmd.enableAddon.label;"
accesskey="&cmd.enableAddon.accesskey;"