您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
给手机网站增加一个可以删除图片的按钮
当前为
// ==UserScript== // @name 过图自定义 // @namespace https://greasyfork.org/zh-CN/scripts/381167 // @version 0.0.05 // @description 给手机网站增加一个可以删除图片的按钮 // @homepage https://greasyfork.org/zh-CN/scripts/381167 // @author unmht001 // @match *://*/* // @grant none // ==/UserScript== function clearzindex(c){ console.log("clear z-index > 100."); (Array.from(document.querySelectorAll('body *'))).map(function (x){ ((+window.getComputedStyle(x).zIndex || 0) >100)?(x.style.cssText+=";z-index:-1"):""; }); setTimeout(function (){ clearzindex(c+c >300000?300000:c+c ); },c) } function addbtn(){ clearzindex(1000); (Array.from(document.querySelectorAll('body *'))).map(function (x){ ((+window.getComputedStyle(x).zIndex || 0) >100)?(x.style.cssText+=";z-index:-1"):""; }); var div=document.createElement("button"); div.innerText = "关闭图片"; div.style.cssText+=";z-index:100"; div.onclick=function () {document.getElementsByTagName("img").map(function (x){x.style.cssText+=";display:none;width:0px;height:0px";})}; //把div元素节点添加到body元素节点中成为其子节点,但是放在body的现有子节点的最后 document.body.appendChild(div); //插入到最前面 document.body.insertBefore(div, document.body.firstElementChild); } addbtn();