Closed Bug 2079204 Opened 1 month ago Closed 1 month ago

Type Session Restore's browser windows as BrowserWindow

Categories

(Firefox :: Session Restore, task)

task

Tracking

()

RESOLVED FIXED
160 Branch
Tracking Status
firefox160 --- fixed

People

(Reporter: dao, Assigned: dao)

References

(Blocks 1 open bug)

Details

Attachments

(2 external files)

Session Restore annotates its windows as Window or ChromeWindow, but every window it tracks is a browser window. Neither type declares gBrowser or the other globals that browser.xhtml's scripts define, so a read like win.gBrowser is unchecked any through the index signature on the generated Window type.

Bug 2076596 adds tools/@types/browser-window.d.ts, which declares those globals. Once it lands, a type BrowserWindow = ChromeWindow & typeof globalThis there, included in this project's tsconfig.json, would type the windows with every global the file declares. SidebarController, PanelUI and arguments need adding to the file for Session Restore's reads.

Depends on: 2081848
Assignee: nobody → dao+bmo
Status: NEW → ASSIGNED

The macOS hidden window and getWindowsFragment's window stay typed as Window, since neither is necessarily a browser window. Passing "about:blank" to addWebTab is behavior-neutral: addTab replaces a missing URI with it before reading it.

Attachment #9659539 - Attachment description: Bug 2079204 - Declare the browser window globals that Session Restore reads. r?#tabbrowser-reviewers → Bug 2079204 - Declare the browser window globals that Session Restore reads. r?Standard8
See Also: → 2081869
Summary: Type Session Restore's browser windows with the globals their scripts define → Type Session Restore's browser windows as BrowserWindow
Attachment #9659540 - Attachment description: Bug 2079204 - Type Session Restore's browser windows with the globals their scripts define. r?#sessionstore-reviewers → Bug 2079204 - Type Session Restore's browser windows as BrowserWindow. r?#sessionstore-reviewers
Attachment #9659539 - Attachment description: Bug 2079204 - Declare the browser window globals that Session Restore reads. r?Standard8 → Bug 2079204 - Declare the browser window globals that Session Restore reads. r?#tabbrowser-reviewers
Pushed by dgottwald@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/55eff1bbadbb https://hg.mozilla.org/integration/autoland/rev/e7d6d5f5cae1 Declare the browser window globals that Session Restore reads. r=Standard8 https://github.com/mozilla-firefox/firefox/commit/4f1a73f873d1 https://hg.mozilla.org/integration/autoland/rev/33a600881aab Type Session Restore's browser windows as BrowserWindow. r=sessionstore-reviewers,sclements
Pushed by smolnar@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/6b62da2fd9b0 https://hg.mozilla.org/integration/autoland/rev/a934bacc967a Revert "Bug 2079204 - Type Session Restore's browser windows as BrowserWindow. r=sessionstore-reviewers,sclements" for causing documentation failures
Flags: needinfo?(dao+bmo)
Pushed by dgottwald@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/82c8caad80fc https://hg.mozilla.org/integration/autoland/rev/6b2beb9cafa3 Declare the browser window globals that Session Restore reads. r=Standard8 https://github.com/mozilla-firefox/firefox/commit/4f02934f1a9e https://hg.mozilla.org/integration/autoland/rev/10502eb8b2eb Type Session Restore's browser windows as BrowserWindow. r=sessionstore-reviewers,sclements
Flags: needinfo?(dao+bmo)
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 160 Branch
QA Whiteboard: [qa-triage-done-c161/b160]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: