Deprecating the chrome and resource protocols

37 views
Skip to first unread message

Dave Townsend

unread,
Jun 7, 2023, 9:06:11 AM6/7/23
to dev-pl...@mozilla.org, Firefox Dev
Hi all. I've written up a proposal for moving us away from the confusing chrome and resource URLs that we use internally to reference files in the build in favour of a new simpler URL scheme based on the file's path in the source tree. This will make it clearer to developers where code is coming from and open up new possibilities for linting, intellisense in editors, and other automated tools.

While it doesn't cover completely removing the chrome and resource protocol it does cover removing the majority of our uses of them (HTML, CSS and JavaScript files). The first few stages detailed in the proposal have already been prototyped and so I'm looking for any comments or concerns on the plan before we begin to move forwards.


Dave Townsend

unread,
Jun 7, 2023, 9:21:10 AM6/7/23
to dev-pl...@mozilla.org, Firefox Dev

Sam Foster

unread,
Jun 7, 2023, 7:59:03 PM6/7/23
to Dave Townsend, dev-pl...@mozilla.org, Firefox Dev
I was just reading the (now removed?) docs http://www.devdoc.net/web/developer.mozilla.org/en-US/docs/Web/CSS/-moz-context-properties.html for -moz-context-properties, and I don't know to what extent that content remains true, but it says our support for `-moz-context-properties` is tied to the chrome: and resource: schemes. Would we need a new way to gate this kind of feature or just port that directly over to moz-src:?

/sfoster

--
You received this message because you are subscribed to the Google Groups "firef...@mozilla.org" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firefox-dev...@mozilla.org.
To view this discussion on the web visit https://groups.google.com/a/mozilla.org/d/msgid/firefox-dev/CAPMxTNpqfgq0Ex%3DM4XA1iw62uBff0r03gmcASp9%2BuPoxMqyYQA%40mail.gmail.com.

Daniel Veditz

unread,
Jun 8, 2023, 10:18:33 AM6/8/23
to Sam Foster, Dave Townsend, dev-pl...@mozilla.org, Firefox Dev
We're trying to get rid of the non-standard -moz-context in favor of a newer standard feature (bug 1782815), but yes, to the extent we still need "chrome-only" features they would be supported by the new thing. This is the first I've heard of replacing chrome:// but I imagine the implementation is mostly a new name mapping. In this particular case we'd have to add the new scheme to URLExtraData::ChromeRulesEnabled(), but hopefully most such places are written to check protocol flags on the URL instead and will "just work" when we add new schemes (which was the point of having protocol flags).

-Dan Veditz

Reply all
Reply to author
Forward
0 new messages