nexusmods-image

nexusmods模糊图片直接显示

  1. // ==UserScript==
  2. // @name nexusmods-image
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.1
  5. // @license MPL-2.0
  6. // @description nexusmods模糊图片直接显示
  7. // @author brackrock12
  8. // @match https://www.nexusmods.com/*
  9. // @require http://libs.baidu.com/jquery/2.0.0/jquery.min.js
  10. // ==/UserScript==
  11.  
  12. (function () {
  13. 'use strict';
  14.  
  15. function show_Image() {
  16.  
  17. $("[class*='blur-image']").each(function () {
  18. const img = $(this);
  19. const classlist = img.attr('class').split(' ');
  20. classlist.forEach(element => {
  21. if (element.indexOf('blur-image') > -1) {
  22. img.removeClass(element);
  23. }
  24. });
  25. });
  26.  
  27. $(".mod_adult_warning_wrapper").each(function () {
  28. $(this).hide();
  29. });
  30. $(".unblur-btn").each(function () {
  31. $(this).hide();
  32. });
  33. $(".blur-description").each(function () {
  34. $(this).removeClass('blur-description');
  35. });
  36.  
  37. if ($(".mod_adult_warning_wrapper").length == 0) return;
  38.  
  39. // Firefox和Chrome早期版本中带有前缀
  40. var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver
  41. // 选择目标节点
  42. var target = document.querySelector('body');
  43. // 创建观察者对象
  44. var observer = new MutationObserver(function (mutations) {
  45. const subimg = $("[class*='blur-image']");
  46. if (subimg.length == 0) {
  47. return;
  48. }
  49. subimg.each(function () {
  50. const img = $(this);
  51. const classlist = img.attr('class').split(' ');
  52. classlist.forEach(element => {
  53. if (element.indexOf('blur-image') > -1) {
  54. img.removeClass(element);
  55. }
  56. });
  57. });
  58. $(".unblur-btn").each(function () {
  59. $(this).hide();
  60. });
  61. // if (subimg.length == 0) {
  62. // observer.disconnect();
  63. // }
  64. });
  65. // 配置观察选项:
  66. var config = { attributes: true, childList: true, characterData: true, subtree: true } // 传入目标节点和观察选项
  67. observer.observe(target, config);
  68. }
  69.  
  70. setTimeout(show_Image, 100);
  71.  
  72. })();

QingJ © 2025

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