// ==UserScript== // @icon https://nd-static.bdstatic.com/v20-static/static/favicon.ico // @name 百度云精简 // @namespace taozhiyu.gitee.io // @version 0.1.7 // @description 删除“复制这段内容后打开百度网盘手机App,操作更方便哦,来自百度会员超级无敌永久svip”,精简部主页广告、邀请 // @author 涛之雨 // @match *://pan.baidu.com/disk/* // @match *://yun.baidu.com/disk/* // @grant none // @home https://greasyfork.org/zh-CN/scripts/422814 // @license GPL-3.0-only // @downloadURL none // ==/UserScript== /**********************************************\ * 修改自https://greasyfork.org/zh-CN/scripts/374100 * 修复 + “个人分享”界面“复制这段内容...”移除失败的bug * 新增 + 删除主界面的部分垃圾(可以自行对比) * 新增 + 关闭4秒内主动弹出的【设备管理】、【新功能测试】、【在线文档】、【在线解压】、等等。。。窗口 \************************************************/ (function() { 'use strict'; let t = " ", e = "text", o = "去除小尾巴失败o(╥﹏╥)o", a = "body", l = "copy",y=true; document.querySelector(a).addEventListener(l, function(a) {try {let l = a.target.value;l = l.split(t).filter((t, e) => {if(!!t.match(/手机App|复制这段/))y=false;return y}).join("").replace("提取码"," 提取码"),a.clipboardData.setData(e, l),a.preventDefault(),y=true; } catch (a) { console.log(o);}}); let id=setInterval(()=>{ document.querySelectorAll(".close-mask").forEach(a=>{console.log("关闭",a);a.click()}); document.querySelectorAll(".dialog-close").forEach(a=>{console.log("关闭",a);a.click()}); document.querySelectorAll(".wp-guide-dialog-close").forEach(a=>{console.log("关闭",a);a.click()}); document.querySelectorAll(".guide-dialog-close").forEach(a=>{console.log("关闭",a);a.click()}); document.querySelectorAll(".wp-side-options").forEach((a)=>{a.style.display="none";a.style.width=0;a.style.overflow="hidden"}); document.querySelectorAll(".wp-disk-header__right-item").forEach((a)=>{if(a.href&&!!a.href.match(/buy/)){a.style.display="none";a.style.width=0;a.style.overflow="hidden";}}); document.querySelectorAll(".module-header-wrapper > dl > dd[node-type='header-union']").forEach((a)=>{a.style.display="none";a.style.width=0;a.style.overflow="hidden";}) document.querySelectorAll(".yike-entrance").forEach((a)=>{a.style.display="none";a.style.width=0;a.style.overflow="hidden";}) },100); setTimeout(()=>{clearInterval(id)},4000) document.querySelector(a).addEventListener("mouseup",a=>{ if(a.target.title!=="分享"){return} let id2=setInterval(()=>{document.querySelectorAll(".share-file__link-ad").forEach((a)=>{a.style.display="none";a.style.width=0;a.style.overflow="hidden";})},10); setTimeout(()=>{clearInterval(id2)},1000) }) })();