Remove Plurk css

刪除自定義的 Plurk CSS

  1. // ==UserScript==
  2. // @namespace https://github.com/sheiun/
  3. // @name Remove Plurk css
  4. // @author SheiUn
  5. // @description 刪除自定義的 Plurk CSS
  6. // @version 1.0.0
  7. // @license LGPLv3
  8. // @match https://www.plurk.com/*
  9. // ==/UserScript==
  10.  
  11. function removejscssfile(filename, filetype) {
  12. var targetelement = filetype == "js" ? "script" : filetype == "css" ? "link" : "none";
  13. var targetattr = filetype == "js" ? "src" : filetype == "css" ? "href" : "none";
  14. var allsuspects = document.getElementsByTagName(targetelement);
  15. for (var i = allsuspects.length; i >= 0; i--) {
  16. if (allsuspects[i] && allsuspects[i].getAttribute(targetattr) != null && allsuspects[i].getAttribute(targetattr).indexOf(filename) != -1) allsuspects[i].parentNode.removeChild(allsuspects[i])
  17. }
  18. }
  19. removejscssfile("/Users/getCustomCss", "css");