Closed Bug 1458840 Opened 6 years ago Closed 6 years ago

Migrate restart command to browser console

Categories

(DevTools Graveyard :: Graphic Commandline and Toolbar, enhancement)

enhancement
Not set
normal

Tracking

(firefox61 fixed)

RESOLVED FIXED
Firefox 61
Tracking Status
firefox61 --- fixed

People

(Reporter: sole, Assigned: bgrins)

References

Details

(Keywords: dev-doc-complete)

Attachments

(1 file)

We want to remove GCLI but the restart command is used super often by QA. We have to provide them with an alternative.

After examining options we've decided to make the restart shortcut which is available in local builds in the browser console available to all builds. It is sufficiently 'hidden' that normal users will not accidentally trigger a restart, and it is sufficiently fast that it should not impact QA's workflows negatively.

Brian: "A user could do Ctrl+Shift+J (open Browser Console) then Ctrl+Alt+R (restart the browser). This already exists in local builds but could be turned on in all builds (without adding a new pref)."
We'll either need to stop loading browser-development-helpers.js and copy the quickRestart implementation into the webconsole, or start building browser-development-helpers.js in official builds.

https://searchfox.org/mozilla-central/source/devtools/client/webconsole/new-webconsole.js#244-252
https://searchfox.org/mozilla-central/source/browser/base/content/browser-development-helpers.js
https://searchfox.org/mozilla-central/source/browser/base/jar.mn#58-60
Assignee: nobody → bgrinstead
Status: NEW → ASSIGNED
Comment on attachment 8972938 [details]
Bug 1458840 - Allow restarting the browser with the keyboard shortcut in the Browser Console in all builds;

https://reviewboard.mozilla.org/r/241496/#review247326


Code analysis found 1 defect in this patch:
 - 1 defect found by mozlint

You can run this analysis locally with:
 - `./mach lint path/to/file` (JS/Python)


If you see a problem in this automated review, please report it here: http://bit.ly/2y9N9Vx


::: devtools/client/webconsole/new-webconsole.js:261
(Diff revision 1)
> +   * with Ctrl+Shift+J (open Browser Console) and then Ctrl+Shift+R (restart).
> +   */
> +  quickRestart: function() {
> +    const { Cc, Ci } = require("chrome");
> +    Services.obs.notifyObservers(null, "startupcache-invalidate");
> +    let env = Cc["@mozilla.org/process/environment;1"].

Error: Expected dot to be on same line as property. [eslint: dot-location]
Comment on attachment 8972938 [details]
Bug 1458840 - Allow restarting the browser with the keyboard shortcut in the Browser Console in all builds;

https://reviewboard.mozilla.org/r/241496/#review247334

Thanks, this seems reasonable to me! :)

::: devtools/client/webconsole/new-webconsole.js:258
(Diff revision 2)
> +
> +  /* This is the same as DevelopmentHelpers.quickRestart, but it runs in all
> +   * builds (even official). This allows a user to do a restart + session restore
> +   * with Ctrl+Shift+J (open Browser Console) and then Ctrl+Shift+R (restart).
> +   */
> +  quickRestart: function() {

Would this be better as a helper function outside of this object?  It doesn't use `this`, so it could be a plain function somewhere else in this module.  You could also remove the `bind(this)` above.
Attachment #8972938 - Flags: review?(jryans) → review+
Pushed by bgrinstead@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9f041f2662c8
Allow restarting the browser with the keyboard shortcut in the Browser Console in all builds;r=jryans
https://hg.mozilla.org/mozilla-central/rev/9f041f2662c8
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 61
Product: Firefox → DevTools
:bgrins, do you think we should document this new shortcut?  It seems there's some user interest for this beyond just Firefox QA.  See bug 1471880.
Flags: needinfo?(bgrinstead)
(In reply to J. Ryan Stinnett [:jryans] (use ni?) from comment #9)
> :bgrins, do you think we should document this new shortcut?  It seems
> there's some user interest for this beyond just Firefox QA.  See bug 1471880.

:bgrins said yes on Slack.
Flags: needinfo?(bgrinstead)
Keywords: dev-doc-needed
Added this text to the Browser Console page (https://developer.mozilla.org/en-US/docs/Tools/Browser_Console):

Restart the browser with the command Ctrl + Alt + R (Windows, Linux) or Cmd + Alt + R (Mac) This command restarts the browser with the same tabs open as before the restart.

Also added a note to the 61 release notes:

The Browser Console now includes a command to restart the browser. Use Ctrl + Alt + R (Windows, Linux) or Cmd + Alt + R (Mac) to restart the browser with the same tabs open as before the restart.
Flags: needinfo?(bgrinstead)
(In reply to Irene Smith from comment #12)
> Added this text to the Browser Console page
> (https://developer.mozilla.org/en-US/docs/Tools/Browser_Console):
> 
> Restart the browser with the command Ctrl + Alt + R (Windows, Linux) or Cmd
> + Alt + R (Mac) This command restarts the browser with the same tabs open as
> before the restart.

Thanks, looks good.
Flags: needinfo?(bgrinstead)
Product: DevTools → DevTools Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: