Currently there are a lot of unnecessary absolute chrome:// URLs used under ui/webui/resources. These URLs couple the codebase with Chrome (and browser_tests) unnecessarily.
There is no good reason I can think of to keep using absolute chrome:// URLs when relative URLs can be used. Decoupling from chrome:// URLs can lead to many benefits, for example:
- Running UI unit tests without js2gtest, just with Mocha (a long-standing goal)
- Being able to leverage UI elements outside of Chrome. For example see the WebUI elements demo at https://freshp86.github.io/chromium-webui/demo.html. The demo is pretty useful for designers, and new WebUI developers. The demo is currently hard to maintain because of all the chrome:// URLs. Eventually this demo could be moved within the Chromium repo, without requiring a fork of the WebUI code.
- Being able to run UI elements in jsfiddle/jsbin etc. This makes it very easy to showcase a bug, or experiment with something very quickly, without a full chromium build.
Example CL at https://chromium-review.googlesource.com/c/chromium/src/+/1144610. If there are no objections to this, I am also planning to add PRESUBMIT checks to prevent future additions of unnecessary chrome:// URLS.
Comment 1 by bugdroid1@chromium.org
, Jul 25