Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSS

tampermonkey custom css

function addGlobalStyle(css) {
    var head, style;
    head = document.getElementsByTagName('head')[0];
    if (!head) { return; }
    style = document.createElement('style');
    style.type = 'text/css';
    style.innerHTML = css.replace(/;/g, ' !important;');
    head.appendChild(style);
}
/*  this only works, if you use the function instead of GM_addStyle
 the output of this "addGlobalStyle('body { color: white; background-color: black; }');",

will be "body { color: white !important; background-color: black !important; }');" */


Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #tampermonkey #custom #css
ADD COMMENT
Topic
Name
5+5 =