I have a User Script and I want to apply an external CSS to any web page using that User Script. What possibly could be done for this?
OR
Is it possible that by using JavaScript I can apply an external CSS to any web page?
I am using the following code but it is not working :
var fileref=document.createElement("link");
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", "class.css");
document.getElementsByTagName("head")[0].appendChild(fileref);
1 Answer