Greasy Fork

Greasy Fork is available in English.

PanDownload网页版快捷跳转按钮

百度网盘分享链接页面加个按钮,点击可跳转到 PanDownload 网页版去下载(在“木木”脚本的基础上进行改进,使得页面更美观)

当前为 2019-10-10 提交的版本,查看 最新版本

// ==UserScript==
// @name         PanDownload网页版快捷跳转按钮
// @version      0.0.1
// @namespace     不知道是啥 乱写的
// @description  百度网盘分享链接页面加个按钮,点击可跳转到 PanDownload 网页版去下载(在“木木”脚本的基础上进行改进,使得页面更美观)
// @author       lyydhy
// @match        *://pan.baidu.com/s/*
// @match        *://pan.baidu.com/share/*
// @match        *://yun.baidu.com/s/*
// ==/UserScript==

(function() {
    'use strict';

    function addDiv(){
        var button=document.querySelector("div.x-button-box");
        var css = "color: white;width: 100px;line-height: 35px;text-align: center;border: 1px solid #09AAFF;background-color: #09AAFF;border-radius: 4px;height: 32px;padding:7px;";
        var a = document.createElement("a");
        a.innerHTML="PD网页版";
        a.style.cssText = css;
        button.appendChild(a);
        a.addEventListener("click",function(){
            var url = window.location.href;
            url = url.replace('baidu.com','baiduwp.com');
            window.open(url, "_blank");});

   }
   addDiv();
})();