From 9dd88b59f51fbb6cb0f121181ec8e787b176430e Mon Sep 17 00:00:00 2001 From: Julian Descottes Date: Wed, 29 Apr 2020 16:17:57 +0000 Subject: [PATCH] Bug 1630228 - Enable F12 for all users with selfxss pref > 0 r=Harald,nchevobbe Depends on D71036 Differential Revision: https://phabricator.services.mozilla.com/D71037 --- devtools/startup/DevToolsStartup.jsm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/devtools/startup/DevToolsStartup.jsm b/devtools/startup/DevToolsStartup.jsm index 13056f20b69a..12b4e96e7dad 100644 --- a/devtools/startup/DevToolsStartup.jsm +++ b/devtools/startup/DevToolsStartup.jsm @@ -28,6 +28,7 @@ const kDebuggerPrefs = [ ]; const DEVTOOLS_ENABLED_PREF = "devtools.enabled"; +const DEVTOOLS_F12_DISABLED_PREF = "devtools.experiment.f12.shortcut_disabled"; const DEVTOOLS_POLICY_DISABLED_PREF = "devtools.policy.disabled"; @@ -364,6 +365,13 @@ DevToolsStartup.prototype = { // is over). Services.prefs.setBoolPref(DEVTOOLS_ENABLED_PREF, true); + // The F12 shortcut might be disabled to avoid accidental usage. + // Users who are already considered as devtools users should not be + // impacted. + if (this.isDevToolsUser()) { + Services.prefs.setBoolPref(DEVTOOLS_F12_DISABLED_PREF, false); + } + // Store devtoolsFlag to check it later in onWindowReady. this.devtoolsFlag = flags.devtools;