// ==UserScript== // @name noPIC 一键隐藏/显示全页面图片(摸鱼必备) // @version 1.2 // @description 隐藏图片和标题 // @author fxalll // @match *://*/* // @grant none // @require https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js // @license MIT // @namespace https://greasyfork.org/users/1043548 // @downloadURL none // ==/UserScript== (function () { window.imgHidenSet = null; window.imgShownSet = null; let imgHiden = function() { $(".RichContent-cover-inner").each(function(){ $(this).hide(); }); $(".ZVideoRecommendationItem-thumbnailImage").each(function(){ $(this).hide(); }); $(".QuestionHeader-title").each(function(){ $(this).hide(); }); $("iframee").each(function(){ $(this).hide(); }); $("img").each(function(){ $(this).hide(); }); }; let imgShown = function() { $(".RichContent-cover-inner").each(function(){ $(this).show(); }); $(".ZVideoRecommendationItem-thumbnailImage").each(function(){ $(this).show(); }); $(".QuestionHeader-title").each(function(){ $(this).show(); }); $("iframee").each(function(){ $(this).show(); }); $("img").each(function(){ $(this).show(); }); }; let handleButtonClick = function(){ if (window.imgHidenSet === null) { clearInterval(window.imgShownSet); window.imgShownSet = null; imgHiden() window.imgHidenSet = setInterval(function(){ imgHiden(); }, 300) } else { clearInterval(window.imgHidenSet); window.imgHidenSet = null; imgShown() window.imgShownSet = setInterval(function(){ imgShown(); }, 300) } } // 自动隐藏图片 imgHiden(); window.imgHidenSet = setInterval(function(){ imgHiden(); }, 300) let button = document.createElement('button') button.innerText = "切换图片模式" button.setAttribute("id", "myButton"); button.style.width = "120px" button.style.height = "40px" button.style.position = "fixed" button.style.bottom = "20px" button.style.right = "20px" button.style.background = "#8181819e" button.style.borderRadius = "15px" button.style.zIndex = "99999999999999999999999999999" button.style.color = "#ffffff5c" button.addEventListener("click", handleButtonClick); document.body.appendChild(button); })()