Skip to content

Conversation

@Radless0
Copy link

@Radless0 Radless0 commented Nov 2, 2025

Closing the Library window after the main window used to clear the session state completely; this patch ensures session save is skipped for non-browser windows and adds a test to cover this scenario.

Fix: #11073

- Added check to skip session save from non-browser windows
- Added test to verify Library window doesn't clear session
- Fixes issue where closing Library window last loses tabs
@Radless0 Radless0 requested a review from mr-cheffy as a code owner November 2, 2025 22:02
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. Bug labels Nov 2, 2025
@Radless0 Radless0 changed the title Fix prevent session loss when library is closed after main window Fix prevent session loss when library is closed after main window (Fix: #11073) Nov 2, 2025
@Radless0 Radless0 changed the title Fix prevent session loss when library is closed after main window (Fix: #11073) Fix prevent session loss when library is closed after main window (#11073) Nov 2, 2025
@mr-cheffy
Copy link
Member

Would it also be interesting to also ignore private windows?

@Radless0
Copy link
Author

Radless0 commented Nov 4, 2025

Would it also be interesting to also ignore private windows?

As far as I know, private windows are already excluded from session restore by design, so I think it’s unnecessary to handle them here as well.

@mr-cheffy
Copy link
Member

I dont understand the patch then, because this check for "navigator:browser", isn't it done before by checking if __Ssi exists on the window's attributes?

@Radless0
Copy link
Author

Radless0 commented Nov 4, 2025

I dont understand the patch then, because this check for "navigator:browser", isn't it done before by checking if __Ssi exists on the window's attributes?

In Zen, private windows are handled as a completely separate process (Zen Private Browsing), so they don’t interact with the main session store at all, that’s why I didn’t include them in this patch.

As for the navigator:browser check in Zen, secondary windows like the Library still run inside the main process and may still expose session-related attributes such as __Ssi. That’s why the extra navigator:browser check is needed: it ensures only real browser windows affect the session state when closing.

@Radless0 Radless0 requested a review from mr-cheffy November 10, 2025 12:54
@mr-cheffy
Copy link
Member

Wouldn't it be more interesting to submit this patch to upstream firefox?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tabs lost when closing main window before Library window

2 participants