过图自定义

给手机网站增加一个可以删除图片的按钮

目前为 2019-03-31 提交的版本。查看 最新版本

// ==UserScript==
// @name         过图自定义
// @namespace    https://gf.qytechs.cn/zh-CN/scripts/381167
// @version      0.0.06
// @description  给手机网站增加一个可以删除图片的按钮
// @homepage     https://gf.qytechs.cn/zh-CN/scripts/381167
// @author       unmht001
// @match        *://*/*
// @grant        none
// ==/UserScript==

function clearzindex(c){
  console.log("clear z-index > 100.");
 (Array.from(top.document.querySelectorAll('body *'))).map(function (x){
    ((+window.getComputedStyle(x).zIndex || 0) >100)?(x.style.cssText+=";z-index:-1;display:none"):"";
  });
  setTimeout(function (){
    clearzindex(c+c );
    
  },c)
  
}



function addbtn(){
  clearzindex(1000);
  
  var div =top.document.createElement("div");
  div.style.cssText+=";position:fixed;z-index:100";
  var b1=top.document.createElement("button");
  b1.innerText = "弹出文字";  
  b1.onclick=function () {
    alert(top.document.body.innerText);
    window.scrollTo(0,top.document.body.clientHeight)
  };
  div.appendChild(b1);

  var b2=top.document.createElement("button");
  b2.innerText = "关闭图片";
  b2.onclick=function () {
    Array.from(top.document.getElementsByTagName("img")).map(
      function (x){x.style.cssText+=";display:none;width:0px;height:0px";}
    );
  };

  div.appendChild(b2);
  
  top.document.body.insertBefore(div, top.document.body.firstElementChild);  
  
  
}
addbtn();

QingJ © 2025

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