Migrate restart command to browser console

RESOLVED FIXED in Firefox 61

Status

enhancement
RESOLVED FIXED
a year ago
7 months ago

People

(Reporter: sole, Assigned: bgrins)

Tracking

({dev-doc-complete})

unspecified
Firefox 61
Dependency tree / graph

Firefox Tracking Flags

(firefox61 fixed)

Details

Attachments

(1 attachment)

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)."
(Assignee)

Comment 1

a year ago
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 3

a year ago
mozreview-review
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 hidden (mozreview-request)

Comment 5

a year ago
mozreview-review
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+
Comment hidden (mozreview-request)

Comment 7

a year ago
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

Comment 8

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/9f041f2662c8
Status: ASSIGNED → RESOLVED
Last Resolved: a year ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 61

Updated

10 months ago
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)
Duplicate of this bug: 1471880
(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

Comment 12

8 months ago
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)
(Assignee)

Comment 13

8 months ago
(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)

Updated

7 months ago
Product: DevTools → DevTools Graveyard
You need to log in before you can comment on or make changes to this bug.