2020-01-03 21:13:46 -08:00
|
|
|
// ==UserScript==
|
|
|
|
// @name DomainStyles
|
|
|
|
// @namespace https://github.com/hlissner
|
|
|
|
// @description Make it possible to use per-domain stylesheets.
|
|
|
|
// @include *
|
|
|
|
// @run-at document-start
|
|
|
|
// @version 1
|
|
|
|
// @author Henrik Lissner
|
|
|
|
// ==/UserScript==
|
|
|
|
|
2021-02-09 19:07:07 -08:00
|
|
|
(function () {
|
2020-01-03 21:13:46 -08:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
document.addEventListener('readystatechange', function onReadyStateChange() {
|
|
|
|
if (document.readyState == 'interactive') {
|
|
|
|
const doc = document.documentElement;
|
|
|
|
doc.setAttribute('qb-url', window.location.href);
|
|
|
|
doc.setAttribute('qb-domain', window.location.host);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
})();
|