helm/config/qutebrowser/greasemonkey/per-domain-stylesheets.user.js

22 lines
594 B
JavaScript
Raw Normal View History

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==
(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);
}
});
})();