Yun Pan WAP Redirect

重定向百度云盘的 WAP 页面到普通页面

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Yun Pan WAP Redirect
// @description  重定向百度云盘的 WAP 页面到普通页面
// @author       wenLiangcan
// @version      0.3
// @namespace    https://github.com/wenLiangcan
// @homepage     https://github.com/wenLiangcan/Userscripts
// @license      GPL version 3 (http://www.gnu.org/licenses/gpl.txt)
// @copyright    Copyright © 2014-2016 wenLiangcan
// @updateURL
// @downloadURL
// @include      http://*
// @include      https://*
// @run-at       document-end
// @grant        none
// ==/UserScript==

(function() {
    if (/^http:\/\/(pan|yun)\.baidu\.com\/wap\/link\?.*?$/.test(document.URL)) {
        window.location.href = document.URL.replace('wap', 'share');
    }
    else if (/^http:\/\/pan\.baidu\.com\/wap\/share\/.*?$/.test(document.URL)) {
        window.location.href = document.URL.replace('wap/', '');
    }
    else if (/^http:\/\/pan\.baidu\.com\/wap\/album\/.*?$/.test(document.URL)) {
        window.location.href = document.URL.replace('wap', 'pcloud');
    }
})();