Bug 1388738 - Add comment for devtools-startup developerToggleCreated flag. r=ochameau, a=gchang
authorJulian Descottes <jdescottes@mozilla.com>
Thu, 10 Aug 2017 11:58:36 +0200
changeset 423656 e9b8e3fb359c0e8956c148e0b37081ba0ca594e6
parent 423655 ba9cc5295263af54d9ef4fedb7ecbbbc1cd9fa2c
child 423657 9b28ea0fe4e5cf75867ece02ca120fb5f6e5e92f
push id1517
push userjlorenzo@mozilla.com
push dateThu, 14 Sep 2017 16:50:54 +0000
treeherdermozilla-release@3b41fd564418 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersochameau, gchang
bugs1388738
milestone56.0
Bug 1388738 - Add comment for devtools-startup developerToggleCreated flag. r=ochameau, a=gchang MozReview-Commit-ID: FN4YuM7VpHf
devtools/client/devtools-startup.js
--- a/devtools/client/devtools-startup.js
+++ b/devtools/client/devtools-startup.js
@@ -233,16 +233,19 @@ DevToolsStartup.prototype = {
    * But instead of implementing the actual actions, defer to DevTools codebase.
    * In most cases, it only needs to call this.initDevTools which handles the rest.
    * We do that to prevent loading any DevTools module until the user intent to use them.
    */
   hookWindow(window) {
     // Key Shortcuts need to be added on all the created windows.
     this.hookKeyShortcuts(window);
 
+    // In some situations (e.g. starting Firefox with --jsconsole) DevTools will be
+    // initialized before the first browser-delayed-startup-finished event is received.
+    // We use a dedicated flag because we still need to hook the developer toggle.
     if (!this.developerToggleCreated) {
       this.hookDeveloperToggle();
       this.developerToggleCreated = true;
     }
 
     // The developer menu hook only needs to be added if devtools have not been
     // initialized yet.
     if (!this.initialized) {