Closed Bug 1936212 Opened 2 months ago Closed 1 day ago

Sidebar is unexpectedly visible in a popup window with a profile migrated from old versions

Categories

(Firefox :: Sidebar, defect, P2)

defect

Tracking

()

RESOLVED DUPLICATE of bug 1942314
Tracking Status
firefox135 --- affected
firefox136 + affected

People

(Reporter: yuki, Assigned: sfoster)

References

Details

(Whiteboard: [fidefe-sidebar])

The element #sidebar-box can have persistent checked attribute which was saved by an old version Firefox, and it triggers unexpectedly visible sidebar in popup windows on new versions of Firefox.

Steps to reproduce

  1. Install Firefox ESR115 to C:\Program Files\Mozilla Firefox ESR115.
  2. Install Nightly to C:\Program Files\Firefox Nightly.
  3. Create a blank folder at %temp%\temporary-profile.
  4. Start Firefox ESR115 with the blank folder as its profile: "C:\Program Files\Mozilla Firefox ESR115\firefox.exe" -profile "%temp%\temporary-profile"
  5. Hit Ctrl-B to show the bookmarks sidebar.
  6. Exit Firefox ESR115.
  7. Start Nightly with the profile initialized by Firefox ESR115: "C:\Program Files\Firefox Nightly\firefox.exe" -profile "%temp%\temporary-profile"
  8. Go to about:preferences#experimental
  9. Check to "Sidebar" to activate new style sidebar.
  10. Go to https://javascript.info/popup-windows#example-a-minimalistic-window
  11. Click the "play" button on the second testcase which opens 600x300 popup window with params scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no,width=600,height=300,left=100,top=100.

Expected result

  • A popup window is opened with no sidebar.

Actual result

  • A popup window is opened with visible sidebar.

Environment

  • Firefox Nightly 135.0a1 (Build ID: 20241209213901)

The "checked" attribute was saved by SidebarUI.uninit().
https://searchfox.org/mozilla-esr115/rev/62894581b8b26d2fb0b2565791aa7c7a25dec3dd/browser/base/content/browser-sidebar.js#140
SidebarController.uninit() in Nightly has no such operation.
https://searchfox.org/mozilla-central/rev/e6733c6143dc6a1bd32c9c65d685528deb1ba895/browser/components/sidebar/browser-sidebar.js#436

And, wasOpen at this line becomes true if the "checked" is restored from xulstore.json. It shows the #sidebar-main always even if it is apopup window.
https://searchfox.org/mozilla-central/rev/e6733c6143dc6a1bd32c9c65d685528deb1ba895/browser/components/sidebar/browser-sidebar.js#811

Thanks for filing this and tracking down the culprit. While we should avoid writing nonsense into the saved session, we should expect and handle nonsense regardless when restoring a session. So adding a are-we-a-popup-window check there in startDelayedLoad seems prudent.

Severity: -- → S3
Priority: -- → P2
Whiteboard: [fidefe-sidebar]
Assignee: nobody → sfoster
Status: NEW → ASSIGNED

As suspected, this seems to have been fixed by bug 1942314, whose patch includes a bunch of checks to ensure we avoid saving sidebar state for a popup window, and avoid showing either the sidebar launcher or panel for a popup window.

Status: ASSIGNED → RESOLVED
Closed: 1 day ago
Duplicate of bug: 1942314
Resolution: --- → DUPLICATE

[Tracking Requested - why for this release]:
We can expect something similar to this scenario to occur on update to 136. Once the patch on bug 1942314 is uplifted, it would be good to also verify this bug is fixed.

You need to log in before you can comment on or make changes to this bug.