Posted By

nasso on 03/14/11


Tagged

css greasemonkey userscript


Versions (?)

greaseMonkey - Ajouter votre css personnelle sur vos pages - Add your owner css in your html's code


 / Published in: CSS
 

  1. // ==UserScript==
  2. // @name Design css
  3. // @namespace
  4. // @include http://www.example.com/*
  5. // ==/UserScript==
  6.  
  7. var css = "@import url(http://localhost/your_css);";
  8.  
  9. if (typeof GM_addStyle != "undefined") {
  10. GM_addStyle(css);
  11. } else if (typeof addStyle != "undefined") {
  12. addStyle(css);
  13. } else {
  14. var heads = document.getElementsByTagName("head");
  15. if (heads.length > 0) {
  16. var node = document.createElement("style");
  17. node.type = "text/css";
  18. node.innerHTML = css;
  19. heads[0].appendChild(node);
  20. }
  21. }

Report this snippet  

You need to login to post a comment.