For T363695: Create a Wikimedia login domain that can be served by any wiki we are configuring MediaWiki to display login pages under a different domain and URL structure, and to reduce complexity we set $wgLoadScript to a full URL to the standard domain, so load.php is always called via the same domain. That doesn't quite work because when accessed via the standard domain, ResourceLoader will use relative URLs, which get written into the startup module: https://sso.wikimedia.org/en.wikipedia.org/wiki/Special:Userlogin calls https://en.wikipedia.org/w/load.php?modules=startup which is dynamically generated JS and will contain something like mw.loader.setSource( 'local', '/w/load.php' ) and then mw.loader will use the wrong URL.
To minimize the changes necessitated by SUL3, rather than expanding URLs everywhere, we only want to expand them where needed, and only on Wikimedia sites (ie. with a hook rather than by default).
, and that will be used by some ResourceLoader components (the startup module at least) will use relative URLs which will be interpreted in the context of the
