Bug 1386821 - call initDevTools if devtools.toolbar.visible is true;r=ochameau

MozReview-Commit-ID: C1EFv9T0VKS

--HG--
extra : rebase_source : dc80edf968e75cfdbf3556c062901cbf9875c4a6
This commit is contained in:
Julian Descottes 2017-08-03 08:57:38 +02:00
parent 5a41a0dd63
commit 67391889ec
3 changed files with 15 additions and 2 deletions

View File

@ -18,7 +18,6 @@ pref("devtools.loader.hotreload", false);
// Developer toolbar preferences
pref("devtools.toolbar.enabled", true);
pref("devtools.toolbar.visible", false);
// Enable DevTools WebIDE by default
pref("devtools.webide.enabled", true);

View File

@ -17,3 +17,6 @@ sticky_pref("devtools.theme", "dark");
#else
sticky_pref("devtools.theme", "light");
#endif
// Should the devtools toolbar be opened on startup
pref("devtools.toolbar.visible", false);

View File

@ -26,6 +26,11 @@ const kDebuggerPrefs = [
"devtools.debugger.remote-enabled",
"devtools.chrome.enabled"
];
// If devtools.toolbar.visible is set to true, the developer toolbar should appear on
// startup.
const TOOLBAR_VISIBLE_PREF = "devtools.toolbar.visible";
const { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
XPCOMUtils.defineLazyModuleGetter(this, "Services",
"resource://gre/modules/Services.jsm");
@ -193,6 +198,12 @@ DevToolsStartup.prototype = {
let onWindowReady = window => {
this.hookWindow(window);
if (Services.prefs.getBoolPref(TOOLBAR_VISIBLE_PREF, false)) {
// Loading devtools-browser will open the developer toolbar by also checking this
// pref.
this.initDevTools();
}
if (devtoolsFlag) {
this.handleDevToolsFlag(window);
// This listener is called for all Firefox windows, but we want to execute
@ -366,7 +377,7 @@ DevToolsStartup.prototype = {
initialized: false,
initDevTools: function (reason) {
if (!this.initialized) {
if (reason && !this.initialized) {
// Only save the first call for each firefox run as next call
// won't necessarely start the tool. For example key shortcuts may
// only change the currently selected tool.