DeepSeek 网页端历史对话锚点辅助

张开发
2026/4/10 1:55:11 15 分钟阅读

分享文章

DeepSeek 网页端历史对话锚点辅助
说明习惯用网页端的AI工具比如deepseek,编码往往会又较长的内容输出且懒得新建对话所有一个对话可能有几十次问答想要找历史内容的时候就需要疯狂拉滚动条所以做个简单的锚点工具快速找到某一个问答不过deepseek的网页版布局比较满临时把锚点工具放到右上角用。流程1、获取所有提问刷新后会有异步加载即不能立刻拿到所有的提问历史需要拖动滚动条到最开始如果没有关闭过该对话则可以直接用2、记录提问的顺序和锚点绑定通过顺序锚点到对应的提问元素位置效果代码可以加到油猴或者直接控制台执行通常用来解决一次会话多次问答的历史记录快速跳转// UserScript// name AI对话快捷方式// namespace http://tampermonkey.net/// version 2026-04-09// description try to take over the world!// author You// match https://yuanbao.tencent.com/chat/naQivTmsDa/22467c58-503f-4dce-8461-c82d3dab3a62// icon https://www.google.com/s2/favicons?sz64domaintencent.com// grant none// /UserScript(function(){use strict;// Your code here...constTickAni(tick2000){letstartnull,handlenull,requestKeynullletisStartfalseletlockElKeynullletloop_{letcurrperformance.now()if((curr-start)tick||startnull){if(!isStart){return}if(lockElKey!document.querySelector(#lockElKey)){stopHandle()return}if(handle){try{if(handle()){stopHandle()return}}catch(e){stopHandle()console.log(e)}}startcurr}requestKeyrequestAnimationFrame(loop)}conststartHandle(p_handle){stopHandle()isStarttruehandlep_handle startnullloop()}conststopHandle_{isStartfalseconsole.log(stop)if(requestKey){cancelAnimationFrame(requestKey)}requestKeynull}return{start:startHandle,stop:stopHandle}}letrenderTatTickAni(2000)lettoolEldocument.createElement(div)toolEl.style.cssText;position:absolute;z-index:5;width:200px;height:400px;overflow:auto;right:20px;top:2px;document.body.append(toolEl)toolEl.addEventListener(click,function(e){letto_indexe.srcElement.getAttribute(to_index)if(to_index){console.log(to_index,to_index);[...document.querySelectorAll(.agent-chat__bubble__content-wrapper)][to_index].scrollIntoView()}})renderTat.start(_{//更新获取最新对话更新操作容器letchatList[...document.querySelectorAll(.agent-chat__bubble__content-wrapper)].map(dd.innerText)if(chatList.length![...toolEl.querySelectorAll(.item)].length){letinnerStrfor(leti0;ichatList.length;i){innerStrtextarea to_index${i} classitem${chatList[i]}/textarea}toolEl.innerHTMLinnerStr}})})();网页豆包可用/*doubao*/constTickAni(tick2000){letstartnull,handlenull,requestKeynullletisStartfalseletlockElKeynullletloop_{letcurrperformance.now()if((curr-start)tick||startnull){if(!isStart){return}if(lockElKey!document.querySelector(#lockElKey)){stopHandle()return}if(handle){try{if(handle()){stopHandle()return}}catch(e){stopHandle()console.log(e)}}startcurr}requestKeyrequestAnimationFrame(loop)}conststartHandle(p_handle){stopHandle()isStarttruehandlep_handle startnullloop()}conststopHandle_{isStartfalseconsole.log(stop)if(requestKey){cancelAnimationFrame(requestKey)}requestKeynull}return{start:startHandle,stop:stopHandle}}letrenderTatTickAni(2000)lettoolEldocument.createElement(div)toolEl.style.cssText;position:absolute;z-index:5;width:200px;height:400px;overflow:auto;right:20px;top:2px;font-size:12pxdocument.body.append(toolEl)toolEl.addEventListener(click,function(e){letto_indexe.srcElement.getAttribute(to_index)if(to_index){console.log(to_index,to_index);[...document.querySelectorAll([data-testidsend_message] [data-testid message_content])][to_index].scrollIntoView()}})renderTat.start(_{//更新获取最新对话更新操作容器letchatList[...document.querySelectorAll([data-testidsend_message] [data-testid message_content])].map(dd.innerText)if(chatList.length![...toolEl.querySelectorAll(.item)].length){letinnerStrfor(leti0;ichatList.length;i){innerStrpre to_index${i} classitem stylemax-height: 80px;border:1px solid #ddd;margin:5px;overflow:auto${chatList[i]}/pre}toolEl.innerHTMLinnerStr}})

更多文章