bdsmlibrary author page mm remover

Adds a button to remove M/M content on an author's page on BDSMLibrary

目前为 2018-11-14 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name bdsmlibrary author page mm remover
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Adds a button to remove M/M content on an author's page on BDSMLibrary
  6. // @author You
  7. // @match http://www.bdsmlibrary.com/stories/author.php?authorid=*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. document.querySelector("h3").innerHTML += `<button class='myButton' style="margin-left: 10px;">Filter Out MM</button>`;
  12.  
  13. document.getElementsByClassName("myButton")[0].addEventListener("click", function(e) {
  14. cleanUp();
  15. });
  16.  
  17. var cleanUp = function() {
  18. console.log("happeninbg now");
  19. Array.prototype.slice.call(document.querySelectorAll("table"), 8).forEach(el => {
  20. if (el.children[0].children[2].children[1].innerText.includes("/m")) el.remove();
  21. });
  22. };