Closed
Bug 1810885
Opened 1 year ago
Closed 1 year ago
Use ChromeMap to rewrite chrome:// URIs in Storybook
Categories
(Firefox :: General, task, P3)
Firefox
General
Tracking
()
RESOLVED
FIXED
112 Branch
Tracking | Status | |
---|---|---|
firefox112 | --- | fixed |
People
(Reporter: mstriemer, Assigned: mstriemer)
References
(Blocks 1 open bug)
Details
(Whiteboard: [recomp])
Attachments
(1 file)
In bug 1804969 a webpack plugin was added to rewrite some chrome JS URLs. It guesses at some mappings of chrome:// URIs to paths on disk, but there is actually a backend that we can use to generate the mapping for us.
Use ./mach build-backend -b ChromeMap
to generate the chrome-map.json file, which we can then use to rewrite URIs rather than generating the rewrites.json file
The chrome-map.json file is lightly documented in its source [1]
The happy path for something like chrome://global/content/elements/moz-support-link.mjs
appears to be:
- Check if there's a URI override (index 1)
- Find where it's bundled
- Look up
chrome://global/content
in the chrome mappings (index 0) -
"chrome://global/content/": [ "dist/bin/chrome/toolkit/content/global" ],
- Look up
- Find the file in that section
- Look up
dist/bin/chrome/toolkit/content/global
in the file system mappings (index 2) -
"dist/bin/chrome/toolkit/content/global/elements/moz-support-link.mjs": [ "toolkit/content/widgets/moz-support-link/moz-support-link.mjs", null ],
- Look up
Note that the file has some globs on it. Hopefully those aren't too bad to handle, for example the private browsing assets, chrome://browser/content/assets/focus-logo.svg
is mapped by:
"dist/bin/browser/chrome/browser/content/browser/assets/": [
"browser/components/privatebrowsing/content/assets/*",
null
],
Updated•1 year ago
|
Assignee | ||
Updated•1 year ago
|
Summary: Use ChromeMap to rewrute chrome:// URIs in Storybook → Use ChromeMap to rewrite chrome:// URIs in Storybook
Updated•1 year ago
|
Whiteboard: [fidefe-reusable-components-ms1] → [fidefe-reusable-components-ms2]
Assignee | ||
Comment 1•1 year ago
|
||
Updated•1 year ago
|
Assignee: nobody → mstriemer
Status: NEW → ASSIGNED
Pushed by mstriemer@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1ba9059ff3eb Use ChromeMap for rewriting chrome:// URIs in Storybook r=hjones
Comment 3•1 year ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
status-firefox112:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 112 Branch
Updated•2 months ago
|
Whiteboard: [fidefe-reusable-components-ms2] → [recomp]
You need to log in
before you can comment on or make changes to this bug.
Description
•