Greasy Fork

Greasy Fork is available in English.

百度云精简

删除“复制这段内容后打开百度网盘手机App,操作更方便哦,来自百度会员超级无敌永久svip”,精简部主页广告、邀请

当前为 2021-03-09 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @icon         https://nd-static.bdstatic.com/v20-static/static/favicon.ico
// @name         百度云精简
// @namespace    taozhiyu.gitee.io
// @version      0.2.5
// @description  删除“复制这段内容后打开百度网盘手机App,操作更方便哦,来自百度会员超级无敌永久svip”,精简部主页广告、邀请
// @author       涛之雨
// @match        *://pan.baidu.com/disk/*
// @match        *://pan.baidu.com/mbox/*
// @match        *://pan.baidu.com/play/*
// @match        *://yun.baidu.com/disk/*
// @match        *://yun.baidu.com/mbox/*
// @match        *://yun.baidu.com/play/*
// @grant	     GM_addStyle
// @home-url	 http://greasyfork.icu/zh-CN/scripts/422814
// ==/UserScript==
/**********************************************\
 * 修改自http://greasyfork.icu/zh-CN/scripts/374100
 * V 0.2.5
 * 新增对于“在线视频”界面的支持
 * TODO : 加上倍速播放按钮
 * V 0.2.4
 * 新增对于“分享”界面的支持
 * V 0.2.3
 * 删除 - 百度文库相关代码,迁移到新项目
 * V 0.2.1
 * 新增 + 百度文库大量垃圾、广告删除
 * TODO : 正在研究非VIP会员免【广告全屏阅读】
 * V 0.1.7
 * 修复 + “个人分享”界面“复制这段内容...”移除失败的bug
 * 新增 + 删除主界面的部分垃圾(可以自行对比)
 * 新增 + 关闭4秒内主动弹出的【设备管理】、【新功能测试】、【在线文档】、【在线解压】、等等。。。窗口
\************************************************/
(function() {
    'use strict';
    GM_addStyle(`
.hx-right-bottom,.title-wrap > .join-vip,.title-wrap > .info,.hx-bottom-wrapper,.hx-recom-wrapper,.app-btn,.hx-warp,.relative-doc-ad-wrapper,.qr-wrapper,.side-doc-tool-wrapper,.feedback-wrapper,.vip-pop-wrap,.red-point,.wp-side-options,.module-header-wrapper > dl > dd[node-type='header-union'],.yike-entrance,.find-light-icon,.newIcon,.app-download,.app-notice,.icon-notice,.icon-feedback,.app-feedback,.wp-disk-header__right-item,.bz-doc-tool-dialog-fix,.ex-wrapper,.fixed-activity-bar,.vip-card-wrap,.vip-activity-content,.tips{
display:none!important;
width:0!important;
overflow:hidden!important;
}
`)
    if(location.href.indexOf("baidu.com/disk/")>=0){
        let t = " ", e = "text", o = "去除小尾巴失败o(╥﹏╥)o", a = "body", l = "copy",y=true,f=(a)=>{a.style.display="none";a.style.width=0;a.style.overflow="hidden"};
        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=>{a.click()});
            document.querySelectorAll(".dialog-close").forEach(a=>{a.click()});
            document.querySelectorAll(".wp-guide-dialog-close").forEach(a=>{a.click()});
            document.querySelectorAll(".guide-dialog-close").forEach(a=>{a.click()});
            document.querySelectorAll(".wp-disk-header__right-item").forEach((a)=>{if(a.href&&!!a.href.match(/buy|addnew/)){f(a);}});
        },1);
        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)=>{f(a);})},10);
            setTimeout(()=>{clearInterval(id2)},1000)
        })
    }
})();