Searchfox Update: Linkify chrome:// and resource:// URLs for JS files

326 views
Skip to first unread message

Tooru Fujisawa

unread,
May 8, 2024, 11:35:27 PM5/8/24
to dev-pl...@mozilla.org
Hello Searchfox users!

I'm happy to announce that now chrome:// and recource:// URLs are linkified between JS files in Searchfox.

Clicking on chrome/resource URL strings in JS files now shows "Go to definition of PATH_TO_JS" menu item and "Search for PATH_TO_JS" menu item, just in the same way as other symbols. You can jump to the original JS file without thinking about the chrome/resource URL mapping :)

Example:
1. open https://searchfox.org/mozilla-central/source/browser/base/content/aboutDialog-appUpdater.js#15
2. click "resource://gre/modules/AppUpdater.sys.mjs" string
3. click "Go to definition of toolkit/mozapps/update/AppUpdater.sys.mjs" menu item
4. it jumps to https://searchfox.org/mozilla-central/source/toolkit/mozapps/update/AppUpdater.sys.mjs#1

You can also click "(file symbol)" next to the filename in the breadcrumb at the top of the page, and click "Search for PATH_TO_JS" to get the list of the JS consumers of the current file.

People on "alpha" channel can use the diagram feature for the JS files relation.

Examples:
* calls-to: https://searchfox.org/mozilla-central/query/default?q=calls-to%3A%27toolkit%2Fmozapps%2Fupdate%2FAppUpdater.sys.mjs%27%20depth%3A4
* calls-from: https://searchfox.org/mozilla-central/query/default?q=calls-from%3A%27toolkit%2Fmozapps%2Fupdate%2FAppUpdater.sys.mjs%27%20depth%3A4
* calls-between: https://searchfox.org/mozilla-central/query/default?q=calls-between%3A%27browser%2Fcomponents%2Furlbar%2FUrlbarProvidersManager.sys.mjs%27+calls-between%3A%27toolkit%2Fmozapps%2Fupdate%2FAppUpdater.sys.mjs%27+depth%3A4

Currently the feature is available only between JS files, and also relative paths are not supported. The work is tracked in https://bugzilla.mozilla.org/show_bug.cgi?id=1697671 . Stay tuned, and let us know if you find any problem!

Thanks!

--
arai

Barret Rennie

unread,
May 9, 2024, 10:51:27 AM5/9/24
to Tooru Fujisawa, dev-pl...@mozilla.org
This is amazing! I've wanted this feature for so long, especially since its not always obvious how the URIs map to files.

Thank you so much for this. I expect this will lower the barrier for new contributors as well as making Searchfox easier to use for everyone.

-- Barret

--
You received this message because you are subscribed to the Google Groups "dev-pl...@mozilla.org" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dev-platform...@mozilla.org.
To view this discussion on the web visit https://groups.google.com/a/mozilla.org/d/msgid/dev-platform/D0546387-1CAB-4AD0-B7F3-92B0A00B1728%40gmail.com.
Reply all
Reply to author
Forward
0 new messages