DeepSeek Auto Expert Mode

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

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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.

ستحتاج إلى تثبيت إضافة مثل 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();
})();