Closed Bug 2080280 Opened 1 month ago Closed 9 days ago

Convert browser-ctrlTab.js to a module

Categories

(Firefox :: Tabbed Browser, task)

task

Tracking

()

RESOLVED FIXED
163 Branch
Tracking Status
firefox163 --- fixed

People

(Reporter: dao, Assigned: dao)

References

(Blocks 1 open bug)

Details

Attachments

(1 external file)

browser/components/tabbrowser/content/browser-ctrlTab.js is loaded into the browser window with Services.scriptloader.loadSubScript, so the tabbrowser TypeScript project can't check it. Convert it to a module loaded with { global: "current" }, the way bug 2066073 did for tabgroup.js and tabsplitview.js. The tsconfig's content/*.mjs include will then pick it up.

The BrowserComponents.manifest entries name browser.js#ctrlTab because BrowserUtils imports a .mjs entry as a system module, outside the window. The local self becomes helper because no-shadow rejects self in a module.

The typing fixes change runtime shape in ways to check: the tab thumbnail cache moves from expandos on the tab into a module WeakMap, the self-replacing getters redefine themselves with Object.defineProperty, and previews is backed by _previews so _buildPreviews can rebuild it. String(previewColumnCount) passes the same value setProperty's WebIDL conversion did.

Assignee: nobody → dao+bmo
Status: NEW → ASSIGNED
Pushed by dgottwald@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/c298152a24d0 https://hg.mozilla.org/integration/autoland/rev/855eb5caa7c1 Turn the Ctrl+Tab switcher script into a module that browser.js loads lazily. r=niklas,tabbrowser-reviewers,frontend-codestyle-reviewers,mossop
Status: ASSIGNED → RESOLVED
Closed: 9 days ago
Resolution: --- → FIXED
Target Milestone: --- → 163 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: