DLsite filter

filter dlsite result by type

  1. // ==UserScript==
  2. // @name DLsite filter
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description filter dlsite result by type
  6. // @author Oscar0159
  7. // @match https://www.dlsite.com/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=dlsite.com
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. var block_list = ['漫畫', '單篇', '單行本', 'CG・插畫', '雜誌/精選集', '聲音作品・ASMR', '小說'];
  14.  
  15. // 隱藏的透明度
  16. var opacity = "15%";
  17.  
  18. // 是否刪除元素
  19. var delete_element = false;
  20.  
  21. (function() {
  22. 'use strict';
  23.  
  24. window.onload = function() {
  25. var hasElement = document.querySelector(".work_category");
  26. if (hasElement) {
  27. main();
  28. }
  29. }
  30.  
  31. function main(){
  32. var block_elements = document.querySelectorAll('.work_category');
  33.  
  34. block_elements.forEach(function(element) {
  35. var text = element.querySelector('a').textContent;
  36. // check if the text is in the block list
  37. if (block_list.indexOf(text) > -1) {
  38. // hide the element
  39. element.parentNode.parentNode.style.opacity = opacity;
  40.  
  41. if (delete_element) {
  42. // delete the element
  43. element.parentNode.parentNode.parentNode.remove();
  44. }
  45. }
  46. });
  47. }
  48. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址