开发者

How to apply CSS using User Scripts

I have a User Script and I want to apply an external CSS to any web page u开发者_如何转开发sing 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);


<link rel="stylesheet" type="text/css" href="class.css" />
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜