Douban Redirect Script

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

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==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;
        }
    }
})();