Restarting the browser through Cmd+Option+R shortcut doesn't re-open the Browser Toolbox
Categories
(DevTools :: General, defect, P3)
Tracking
(Not tracked)
People
(Reporter: jaws, Unassigned)
References
(Blocks 1 open bug)
Details
STR:
./mach run --jsdebugger
Cmd option R
Expected:
Browser restarts and Browser Toolbox re-opened
Actual:
Browser restarts without the Browser Toolbox re-opened
Comment 1•2 years ago
|
||
Some work was done around Browser + BrowserToolbox restart in Bug 1594639 , Alex might remember specific issue around this?
Comment 2•2 years ago
|
||
Bug 1735748 will disable F5/Cmd+R in the browser toolbox, which was doing only a light reload, reloading only the current toplevel browser.xhtml document.
But this will enable Cmd+Alt+R, which do a full restart (process restart). There is still cases where the browser toolbox won't restart if you restart too quickly and session store didn't have time to save data to disk.
This is based on this key shortcut:
https://searchfox.org/mozilla-central/rev/15b656909e77d3048d4652b894f79a8c719b4b86/browser/base/content/browser-development-helpers.js#16-40
I tried to investigate a bit the SessionStore codebase but wasn't able to find any API to force writing SessionStore to disk before restart.
Jared, if you have any suggestion on how to do that, that would be super helpful!
Reporter | ||
Comment 3•2 years ago
|
||
(In reply to Alexandre Poirot [:ochameau] from comment #2)
I tried to investigate a bit the SessionStore codebase but wasn't able to find any API to force writing SessionStore to disk before restart.
Jared, if you have any suggestion on how to do that, that would be super helpful!
If you could dispatch an event when the Browser Toolbox opens, SessionStore could listen for it and trigger a delayed save. It wouldn't be guaranteed but would probably work for most cases, https://searchfox.org/mozilla-central/rev/15b656909e77d3048d4652b894f79a8c719b4b86/browser/components/sessionstore/SessionStore.jsm#1516-1519
Comment 4•2 years ago
|
||
Oh but wait, the session store codepath we are using is only trigerred when the user manually ask to restore its previous tabs:
https://searchfox.org/mozilla-central/rev/3aaca0a12a2d1463da54933bdbdae2f06fead06f/browser/components/sessionstore/SessionStore.jsm#3834
https://searchfox.org/mozilla-central/rev/3aaca0a12a2d1463da54933bdbdae2f06fead06f/browser/base/content/browser-menubar.inc#248
So that, if you weren't having any tab, you wouldn't even see the menu entry to restore tabs (nor devtools).
We should probably find some other ways to save and restore devtools state, which wouldn't be tied to tabs.
Comment 5•2 years ago
|
||
I'm now wondering which API we could be using. There must be some other component to save such state across reloads.
Or should we be using preferences? custom IndexedDB? custom file in profile?
Comment 6•2 years ago
|
||
(In reply to Alexandre Poirot [:ochameau] from comment #5)
I'm now wondering which API we could be using. There must be some other component to save such state across reloads.
Or should we be using preferences? custom IndexedDB? custom file in profile?
Hi Gijs,
Would you know any which can help with the question from Alex above?
Comment 7•2 years ago
|
||
(In reply to Julian Descottes [:jdescottes] from comment #6)
(In reply to Alexandre Poirot [:ochameau] from comment #5)
I'm now wondering which API we could be using. There must be some other component to save such state across reloads.
Or should we be using preferences? custom IndexedDB? custom file in profile?Hi Gijs,
Would you know any which can help with the question from Alex above?
The answer to your question is, I think, XULStore.
Description
•