From 1f3b89a6c7329a3f71054e3a9ceac85ddd32efe3 Mon Sep 17 00:00:00 2001 From: Robert Helmer Date: Sun, 13 Dec 2015 09:02:17 -0800 Subject: [PATCH] Bug 1209344 - remove debug button from about:addons r=mossop --HG-- extra : transplant_source : %DF-u%83%B8%A5%9E%EA%B5%8D%9B%B1%92G%02m%08%BE%3D%E3 --- .../chrome/mozapps/extensions/extensions.dtd | 2 - .../mozapps/extensions/content/extensions.js | 31 ----- .../mozapps/extensions/content/extensions.xml | 21 ---- .../mozapps/extensions/content/extensions.xul | 8 -- .../extensions/internal/XPIProvider.jsm | 4 - .../test/browser/browser-common.ini | 1 - .../test/browser/browser_debug_button.js | 112 ------------------ .../mozapps/extensions/test/browser/head.js | 2 - .../test/xpcshell/test_isDebuggable.js | 36 ------ .../test/xpcshell/xpcshell-shared.ini | 1 - 10 files changed, 218 deletions(-) delete mode 100644 toolkit/mozapps/extensions/test/browser/browser_debug_button.js delete mode 100644 toolkit/mozapps/extensions/test/xpcshell/test_isDebuggable.js diff --git a/toolkit/locales/en-US/chrome/mozapps/extensions/extensions.dtd b/toolkit/locales/en-US/chrome/mozapps/extensions/extensions.dtd index c32958095abe..989d53145e7f 100644 --- a/toolkit/locales/en-US/chrome/mozapps/extensions/extensions.dtd +++ b/toolkit/locales/en-US/chrome/mozapps/extensions/extensions.dtd @@ -105,8 +105,6 @@ - - diff --git a/toolkit/mozapps/extensions/content/extensions.js b/toolkit/mozapps/extensions/content/extensions.js index 86250973a0e3..2b916a2753a5 100644 --- a/toolkit/mozapps/extensions/content/extensions.js +++ b/toolkit/mozapps/extensions/content/extensions.js @@ -24,10 +24,6 @@ const SIGNING_REQUIRED = CONSTANTS.REQUIRE_SIGNING ? XPCOMUtils.defineLazyModuleGetter(this, "PluralForm", "resource://gre/modules/PluralForm.jsm"); -XPCOMUtils.defineLazyGetter(this, "BrowserToolboxProcess", function() { - return Cu.import("resource://devtools/client/framework/ToolboxProcess.jsm", {}). - BrowserToolboxProcess; -}); XPCOMUtils.defineLazyModuleGetter(this, "Experiments", "resource:///modules/experiments/Experiments.jsm"); @@ -39,8 +35,6 @@ const PREF_GETADDONS_CACHE_ENABLED = "extensions.getAddons.cache.enabled"; const PREF_GETADDONS_CACHE_ID_ENABLED = "extensions.%ID%.getAddons.cache.enabled"; const PREF_UI_TYPE_HIDDEN = "extensions.ui.%TYPE%.hidden"; const PREF_UI_LASTCATEGORY = "extensions.ui.lastCategory"; -const PREF_ADDON_DEBUGGING_ENABLED = "devtools.chrome.enabled"; -const PREF_REMOTE_DEBUGGING_ENABLED = "devtools.debugger.remote-enabled"; const LOADING_MSG_DELAY = 100; @@ -164,9 +158,6 @@ function initialize(event) { } gViewController.loadInitialView(view); - - Services.prefs.addObserver(PREF_ADDON_DEBUGGING_ENABLED, debuggingPrefChanged, false); - Services.prefs.addObserver(PREF_REMOTE_DEBUGGING_ENABLED, debuggingPrefChanged, false); } function notifyInitialized() { @@ -187,8 +178,6 @@ function shutdown() { gEventManager.shutdown(); gViewController.shutdown(); Services.obs.removeObserver(sendEMPong, "EM-ping"); - Services.prefs.removeObserver(PREF_ADDON_DEBUGGING_ENABLED, debuggingPrefChanged); - Services.prefs.removeObserver(PREF_REMOTE_DEBUGGING_ENABLED, debuggingPrefChanged); } function sendEMPong(aSubject, aTopic, aData) { @@ -1077,20 +1066,6 @@ var gViewController = { } }, - cmd_debugItem: { - doCommand: function(aAddon) { - BrowserToolboxProcess.init({ addonID: aAddon.id }); - }, - - isEnabled: function(aAddon) { - let debuggerEnabled = Services.prefs. - getBoolPref(PREF_ADDON_DEBUGGING_ENABLED); - let remoteEnabled = Services.prefs. - getBoolPref(PREF_REMOTE_DEBUGGING_ENABLED); - return aAddon && aAddon.isDebuggable && debuggerEnabled && remoteEnabled; - } - }, - cmd_showItemPreferences: { isEnabled: function(aAddon) { if (!aAddon || @@ -3717,12 +3692,6 @@ var gUpdatesView = { } }; -function debuggingPrefChanged() { - gViewController.updateState(); - gViewController.updateCommands(); - gViewController.notifyViewChanged(); -} - var gDragDrop = { onDragOver: function(aEvent) { var types = aEvent.dataTransfer.types; diff --git a/toolkit/mozapps/extensions/content/extensions.xml b/toolkit/mozapps/extensions/content/extensions.xml index 70e74a13b164..809c01c0d328 100644 --- a/toolkit/mozapps/extensions/content/extensions.xml +++ b/toolkit/mozapps/extensions/content/extensions.xml @@ -877,11 +877,6 @@ tooltiptext="&cmd.showPreferencesUnix.tooltip;" #endif oncommand="document.getBindingParent(this).showPreferences();"/> - - - @@ -1020,10 +1015,6 @@ document.getAnonymousElementByAttribute(this, "anonid", "enable-btn"); - - document.getAnonymousElementByAttribute(this, "anonid", - "debug-btn"); - document.getAnonymousElementByAttribute(this, "anonid", "disable-btn"); @@ -1370,12 +1361,6 @@ this.mAddon.install.state != AddonManager.STATE_INSTALLED); this._showStatus(showProgress ? "progress" : "none"); - let debuggable = this.mAddon.isDebuggable && - Services.prefs.getBoolPref('devtools.chrome.enabled') && - Services.prefs.getBoolPref('devtools.debugger.remote-enabled'); - - this._debugBtn.disabled = this._debugBtn.hidden = !debuggable - if (this.mAddon.type == "experiment") { this.removeAttribute("notification"); let prefix = "experiment."; @@ -1557,12 +1542,6 @@ ]]> - - - - - - @@ -659,10 +655,6 @@ #endif command="cmd_showItemPreferences"/> -