Deepseek Chat Monitor

The blocked thinking and response will be displayed on the right white interface. 右侧白色界面会显示输出后被屏蔽的思考和回复内容。

目前为 2025-01-31 提交的版本。查看 最新版本

// ==UserScript==
// @name         Deepseek Chat Monitor
// @author       okiseji
// @version      1.2
// @description  The blocked thinking and response will be displayed on the right white interface. 右侧白色界面会显示输出后被屏蔽的思考和回复内容。
// @match        https://chat.deepseek.com/*
// @grant        none
// @namespace https://gf.qytechs.cn/users/762448
// ==/UserScript==

(function() {
    'use strict';
    const pluginUI = document.createElement('div');
    pluginUI.id = 'plugin-ui';
    pluginUI.style.position = 'fixed';
    pluginUI.style.top = '0';
    pluginUI.style.right = '20px';
    pluginUI.style.width = '300px';
    pluginUI.style.height = '100%';
    pluginUI.style.overflowY = 'scroll';
    pluginUI.style.backgroundColor = '#f9f9f9';
    pluginUI.style.color = '#333';
    pluginUI.style.border = '1px solid #ccc';
    pluginUI.style.borderRadius = '5px';
    pluginUI.style.padding = '10px';
    pluginUI.style.zIndex = '9999';
    document.body.appendChild(pluginUI);


    let latestChatNum = 2;
    let previousContent = '';
    let longestContent = '';

    function getLatestChatContent() {

        while (true) {
            const selector = `#root > div > div.c3ecdb44 > div.f2eea526 > div > div.b83ee326 > div > div > div.dad65929 > div:nth-child(${latestChatNum})`;
            const element = document.querySelector(selector);

            if (!element) {
                break;
            }

            latestChatNum += 2;
        }

        latestChatNum -= 2;

        const latestChatSelector = `#root > div > div.c3ecdb44 > div.f2eea526 > div > div.b83ee326 > div > div > div.dad65929 > div:nth-child(${latestChatNum})`;
        const latestChatElement = document.querySelector(latestChatSelector);

        if (latestChatElement) {
            const chatContentElement = latestChatElement.querySelector('div.ds-markdown.ds-markdown--block');
            const thinkingContentElement = latestChatElement.querySelector('div.edb250b1 > div.e1675d8b');

            let currentContent = '';

            if (thinkingContentElement) {
                const paragraphs = thinkingContentElement.querySelectorAll('p');
                paragraphs.forEach(p => {
                    currentContent += p.innerText + '\n';
                });
            }

            if (chatContentElement) {
                currentContent += chatContentElement.innerHTML;
            }

            if (currentContent.length > longestContent.length) {
                longestContent = currentContent;
            }

            if (currentContent.length < previousContent.length) {
                pluginUI.innerHTML = '';
                pluginUI.innerHTML = longestContent;
                longestContent = '';
            }

            previousContent = currentContent;
        } else {
            console.log('Cannot find the latest chat');
        }
    }
    window.onload = function(){setTimeout(setInterval(getLatestChatContent, 1000),1000);}
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址