ランキングや検束結果に挟まってるスパムの削除。改善版。

Format
JavaScript
Post date
2021-04-07 19:10
Publication Period
Unlimited
  1. // ==UserScript==
  2. // @name nicoad_killer
  3. // @version 1.1
  4. // @grant none
  5. // @include https://www.nicovideo.jp/*
  6. // @run-at document-start
  7. // ==/UserScript==
  8. (()=>{
  9. function main(){
  10. let st = document.createElement("style");
  11. document.head.appendChild(st);
  12. st.sheet.insertRule(`
  13. .RankingMainNicoad, .nicoadVideoItem, .NicoadMediaObject{
  14. display: none;
  15. }
  16. `);
  17. st.sheet.insertRule(`
  18. .RankingMatrixNicoadsRow{
  19. display: none;
  20. }
  21. `);
  22. }
  23. if(document.head){
  24. main();
  25. }else{
  26. new MutationObserver((mu, obs)=>{
  27. for(let mr of mu){
  28. for(let n of mr.addedNodes){
  29. if(n.tagName == "HEAD"){
  30. obs.disconnect();
  31. main();
  32. }
  33. }
  34. }
  35. }).observe(document, {childList: true, subtree: true});
  36. }
  37. })();
Download Printable view

URL of this paste

Embed with JavaScript

Embed with iframe

Raw text