Open Bug 1660564 Opened 4 years ago Updated 2 months ago

Window type=panel has sidebarAction residing within

Categories

(Firefox :: Session Restore, defect)

Unspecified
macOS
defect

Tracking

()

UNCONFIRMED

People

(Reporter: julianhofstadter, Unassigned)

Details

Attachments

(1 file)

There is a behavior I have observed with panels created with windows.create({ type: "panel"}). If an addon is sporting a UI which is open in the sidebar, when certain conditions are met, if the addon opens a panel, there is a sidebarAction instance living within the panel, even if it is not visible.

The problem this creates is that resources are being drained by the panel's sidebar UI, even though they are of no benefit to the user.

I have verified this on Macos, though the problem may also exist on other OSes.

To demonstrate:

  1. Create new profile.

  2. Ensure "Restore previous session" is checked under Preferences > General > Startup.

  3. Install attached demo addon. ( "Private windows" option not necessary.)

  4. If addon did not automatically open in the sidebar, manually open it from View > Sidebar > Panel / Sidebar Action Demo. (If you had to open it manually, it may be worthwhile to restart Firefox to ensure it restarts with the sidebar open, with demo addon page loaded.)

  5. Open panel using keyboard shortcut Cmd+Shift+0 (Ctrl+Shift+0 on non-Mac).

  6. LEAVE PANEL OPEN and restart Firefox. (This step is necessary to observe the issue.)

  7. Observe the restored panel. (It may or may not display the sidebar - see bug 1659844).

  8. Close the panel using Cmd+W (Ctrl+W non-Mac).

  9. Open a new panel using Cmd+Shift+0 (Ctrl+Shift+0 on non-Mac).

  10. Observe output (Output will be sent to command line if window.dump is enabled, otherwise will be sent to javascript console assuming appropriate settings are made.)

  11. After 2s delay from opening the panel, you should see output like:

>> panelbreaksaddondemo:    PANEL:    hosting windowId: 112    id of panel opened by windows.create: 112
>> panelbreaksaddondemo:    SIDEBAR:    hosting windowId: 112    id of panel opened by windows.create: 112
>> panelbreaksaddondemo:        ATTEMPT TO LOAD SIDEBAR IN PANEL (hosting windowId == id of currently open panel)

Output containing "SIDEBAR:" comes from a page loaded in a sidebar.
Output containing "PANEL:" comes from a page loaded in the panel.
"hosting windowId" is the id of the window in which resides the panel or sidebar.
Note the presence of "SIDEBAR:", meaning a page just got loaded in the sidebar, and also the fact that the id of the panel opened by windows.create" is the same as the hosting windowId of the sidebar, confirming that code is running within the sidebar of the panel (albeit not visible).

  1. Also, if while the panel is focused, you look at View > Sidebar > Panel / Sidebar Action Demo is checked, indicating it is "open" in the panel.

Related: Bug 1659844

Setting a component for this issue in order to get the dev team involved.
If you feel it's an incorrect one please feel free to change it to a more appropriate one.

Component: Untriaged → Session Restore

The severity field is not set for this bug.
:mikedeboer, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(mdeboer)

Canceling needinfo because Mike's account is inactive.

Flags: needinfo?(mdeboer)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: