Closed Bug 1397295 Opened 7 years ago Closed 7 years ago

Browser Toolbox doesn't remember its size and location

Categories

(DevTools :: General, defect, P2)

defect

Tracking

(firefox-esr52 unaffected)

RESOLVED FIXED
Firefox 57
Tracking Status
firefox-esr52 --- unaffected

People

(Reporter: standard8, Assigned: bgrins)

References

(Blocks 1 open bug)

Details

(Keywords: regression)

Attachments

(1 file)

STR

1) Build an artifact build of nightly (I suspect this also works on all nightly builds, this is just what I'm using)
2) Have a "dev" profile and run

./mach run -P dev

3) Open the Browser Toolbox and Browser Console.
4) Resize the toolbox and console windows into something different that you'll remember.
5) Quit Nightly.
6) Start it again as per step 2.
7) Open the Browser Toolbox and Browser Console.

Expected Results

=> Both the toolbox and console are at the size and location set in step 4

Actual Results

=> Only the console remembers its size and location, the toolbox reverts to a "standard" position.

Hence, this makes debugging hard as I have to reset the size and location every time I open it up.
Blocks: dbg-browser
Priority: -- → P2
Works fine in 55 and 56. So this is a new problem with 57. It would be very nice for DevTools, Firefox and WebExtensions developers to have this fixed. Not useful for web developers though. So probably not worth blocking 57, but still would be a nice to have.
I'll try to investigate a bit.
So the initial size and persistence come from this code:

<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
        id="devtools-toolbox-window"
        macanimationtype="document"
        fullscreenbutton="true"
        windowtype="devtools:toolbox"
        width="900" height="600"
        persist="screenX screenY width height sizemode">

in devtools\client\framework\toolbox-process-window.xul

Which seems to say that XUL windows offer some kind of automatic persistence. I'm not seeing any devtools pref that would hold those values.

The weird thing is that it works for non-browser-toolbox toolboxes (normal toolboxes that is). And they use the same code:

<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
        id="devtools-toolbox-window"
        macanimationtype="document"
        fullscreenbutton="true"
        windowtype="devtools:toolbox"
        width="900" height="320"
        persist="screenX screenY width height sizemode">

in devtools\client\framework\toolbox-window.xul
The persist attribute relies on a profile being available, that's where the persisted values end up.
In 57, we changed a few things related to this, so I backed out a few bugs and found the culprit: bug 1392744.

Brian, any idea how that bug could have caused the regression?
Also, do you agree with me about marking this as 57 fix-optional?
Blocks: 1392744
Flags: needinfo?(bgrinstead)
Keywords: regression
(In reply to Patrick Brosset <:pbro> from comment #3)
> The persist attribute relies on a profile being available, that's where the
> persisted values end up.
> In 57, we changed a few things related to this, so I backed out a few bugs
> and found the culprit: bug 1392744.
> 
> Brian, any idea how that bug could have caused the regression?
> Also, do you agree with me about marking this as 57 fix-optional?

That change didn't affect which profile the Browser Toolbox loads with. I suspect the persistence is keyed on the URL, and since we are now passing a query string to specify the port the URL is changing every time it gets opened (https://hg.mozilla.org/mozilla-central/rev/30182d13fb9d#l1.49). So this would have been a problem before with addon toolboxes opened through ToolboxProcess, but all Browser Toolboxes had the same URL.

Mossop, are you aware of a way to make the `persist` attribute work for a page that can be loaded with different query string values? If there's not an easy way to change that, we could use an environment variable instead of a query string value.
Flags: needinfo?(bgrinstead) → needinfo?(dtownsend)
(In reply to Brian Grinstead [:bgrins] from comment #4)
> (In reply to Patrick Brosset <:pbro> from comment #3)
> > The persist attribute relies on a profile being available, that's where the
> > persisted values end up.
> > In 57, we changed a few things related to this, so I backed out a few bugs
> > and found the culprit: bug 1392744.
> > 
> > Brian, any idea how that bug could have caused the regression?
> > Also, do you agree with me about marking this as 57 fix-optional?
> 
> That change didn't affect which profile the Browser Toolbox loads with. I
> suspect the persistence is keyed on the URL, and since we are now passing a
> query string to specify the port the URL is changing every time it gets
> opened (https://hg.mozilla.org/mozilla-central/rev/30182d13fb9d#l1.49). So
> this would have been a problem before with addon toolboxes opened through
> ToolboxProcess, but all Browser Toolboxes had the same URL.

This sounds right to me.

> Mossop, are you aware of a way to make the `persist` attribute work for a
> page that can be loaded with different query string values? If there's not
> an easy way to change that, we could use an environment variable instead of
> a query string value.

Short of changing the persistence system I don't think there is a way.
Flags: needinfo?(dtownsend)
(In reply to Dave Townsend [:mossop] from comment #5)
> > Mossop, are you aware of a way to make the `persist` attribute work for a
> > page that can be loaded with different query string values? If there's not
> > an easy way to change that, we could use an environment variable instead of
> > a query string value.
> 
> Short of changing the persistence system I don't think there is a way.

OK, in that case I'd suggest to fix this bug we migrate the port and addonId query string parameters to environment variables.

I do agree with it being fix-optional for 57, as it's Browser Toolbox only so getting it fixed for local builds is the main priority
Assignee: nobody → bgrinstead
Status: NEW → ASSIGNED
Comment on attachment 8909536 [details]
Bug 1397295 - Use environment variables instead of query string for params to Browser Toolbox;

https://reviewboard.mozilla.org/r/181002/#review186548

Looks good to me, thanks! :)
Attachment #8909536 - Flags: review?(jryans) → review+
Pushed by bgrinstead@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ad4a5b8426ed
Use environment variables instead of query string for params to Browser Toolbox;r=jryans
https://hg.mozilla.org/mozilla-central/rev/ad4a5b8426ed
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 57
Product: Firefox → DevTools
Flags: in-qa-testsuite+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: