DeepSeek Auto Expert Mode

Automatically enables Expert mode on DeepSeek Chat interface after navigation or page load.

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

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

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

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

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

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

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         DeepSeek Auto Expert Mode
// @name:zh-CN   DeepSeek 自动启用 Expert 模式
// @description  Automatically enables Expert mode on DeepSeek Chat interface after navigation or page load.
// @description:zh-CN  在页面加载或路由切换后自动启用 DeepSeek 的 Expert 模式。
// @version      1.2026.04
// @namespace    https://github.com/clanedev
// @author       clane
// @match        https://chat.deepseek.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=deepseek.com
// @run-at       document-idle
// @grant        none
// @license      MIT
// ==/UserScript==

(function () {
    'use strict';

    function switchToExpert(){
        const expertBtn = document.querySelector('[data-model-type="expert"]');

        if (expertBtn && expertBtn.getAttribute('aria-checked') !== 'true') {
            expertBtn.click();
        }
    };


    const origPush = history.pushState;
    history.pushState = function(...args) {
        const result = origPush.apply(this, args);
        window.dispatchEvent(new Event('urlchanged'));
        return result;
    };

    window.addEventListener('popstate', onURLChange);
    window.addEventListener('urlchanged', onURLChange);

    function onURLChange() {
        const path = location.pathname;
        if(path === '/'){
            setTimeout(() => {
                switchToExpert();
            }, 100); // try 100~300ms
        }
    }

    onURLChange();
})();