Douban Redirect Script

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

目前為 2024-03-22 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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;
        }
    }
})();