Some helper functions for userscripts, including:
- applyCss - A more robust alternative to GM_addStyle
- More to come...
Add to your userscript's metadata block:
// @require https://cdn.rawgit.com/HatScripts/UserscriptHelpers/3c55360a/applyCss.min.js
And then call it like so:
applyCss('body { color: white; background-color: black; } img { border: 0; }');
or
applyCss(`
body {
color: white;
background-color: black;
}
img {
border: 0;
}
`);