Douban Redirect Script

豆瓣书影音页面自动跳转到标签按字母顺序排列

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Douban Redirect Script
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  豆瓣书影音页面自动跳转到标签按字母顺序排列
// @author       selfcomm
// @match        https://*.douban.com/*/collect*
// @match        https://*.douban.com/*/do*
// @match        https://*.douban.com/*/wish*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // 获取当前页面的 URL
    var currentURL = window.location.href;

    // 检查当前页面是否匹配 collect、do 或 wish 页面
    var regex = /\/(collect|do|wish)$/;
    if (regex.test(currentURL)) {
        // 构建重定向 URL
        var newURL = currentURL + '?sort=time&start=0&filter=all&mode=grid&tags_sort=name';

        // 跳转到新的 URL
        if (newURL !== currentURL) {
            window.location.href = newURL;
        }
    }
})();