DeepSeek Auto Expert Mode

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

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey, Greasemonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

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

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

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

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

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

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

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