diff --git a/www/common/boot2.js b/www/common/boot2.js index 72519b73e..2ea7f9b73 100644 --- a/www/common/boot2.js +++ b/www/common/boot2.js @@ -3,4 +3,6 @@ define([], function () { // fix up locations so that relative urls work. require.config({ baseUrl: window.location.pathname }); require([document.querySelector('script[data-bootload]').getAttribute('data-bootload')]); + require(['/common/rewrite-css.js']); }); + diff --git a/www/common/rewrite-css.js b/www/common/rewrite-css.js new file mode 100644 index 000000000..98c81b35c --- /dev/null +++ b/www/common/rewrite-css.js @@ -0,0 +1,10 @@ +define([ + '/api/config', +], function (Config) { + if (!(Config && Config.requireConf && Config.requireConf.urlArgs)) { return; } + + document.querySelectorAll('link[rel="stylesheet"][data-rewrite-href]').forEach(function (e) { + e.setAttribute('href', e.getAttribute('data-rewrite-href')); + }); +}); +