Type Session Restore's browser windows as BrowserWindow
Categories
(Firefox :: Session Restore, task)
Tracking
()
| 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.
| Assignee | ||
Comment 1•1 month ago
|
||
Updated•1 month ago
|
| Assignee | ||
Comment 2•1 month ago
|
||
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.
Updated•1 month ago
|
| Assignee | ||
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Comment 5•1 month ago
|
||
Backed out for causing documentation failures
Backout link: https://hg-edge.mozilla.org/integration/autoland/rev/a934bacc967a476b1b8ee347465d9735dd778c00
| Assignee | ||
Updated•1 month ago
|
Comment 7•1 month ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/6b2beb9cafa3
https://hg.mozilla.org/mozilla-central/rev/10502eb8b2eb
Updated•1 month ago
|
Description
•