Skip to content

Instantly share code, notes, and snippets.

@arantius
Created February 22, 2018 16:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arantius/eec890c9ce4ff2f7abee896c0bba664d to your computer and use it in GitHub Desktop.
Save arantius/eec890c9ce4ff2f7abee896c0bba664d to your computer and use it in GitHub Desktop.
GM_addStyle
function GM_addStyle(aCss) {
'use strict';
let head = document.getElementsByTagName('head')[0];
if (head) {
let style = document.createElement('style');
style.setAttribute('type', 'text/css');
style.textContent = aCss;
head.appendChild(style);
return style;
}
return null;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment