当前位置: 首页 > news >正文

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?sz=64&domain=tencent.com// @grant none// ==/UserScript==(function(){'use strict';// Your code here...constTickAni=(tick=2000)=>{letstart=null,handle=null,requestKey=nullletisStart=falseletlockElKey=nullletloop=_=>{letcurr=performance.now()if((curr-start)>=tick||start==null){if(!isStart){return}if(lockElKey&&!document.querySelector('#'+lockElKey)){stopHandle()return}if(handle){try{if(handle()){stopHandle()return}}catch(e){stopHandle()console.log(e)}}start=curr}requestKey=requestAnimationFrame(loop)}conststartHandle=(p_handle)=>{stopHandle()isStart=truehandle=p_handle start=nullloop()}conststopHandle=_=>{isStart=falseconsole.log('stop')if(requestKey){cancelAnimationFrame(requestKey)}requestKey=null}return{start:startHandle,stop:stopHandle}}letrenderTat=TickAni(2000)lettoolEl=document.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_index=e.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(d=>d.innerText)if(chatList.length!=[...toolEl.querySelectorAll('.item')].length){letinnerStr=''for(leti=0;i<chatList.length;i++){innerStr+=`<textarea to_index="${i}" class="item">${chatList[i]}</textarea>`}toolEl.innerHTML=innerStr}})})();

网页豆包可用

/*doubao*/constTickAni=(tick=2000)=>{letstart=null,handle=null,requestKey=nullletisStart=falseletlockElKey=nullletloop=_=>{letcurr=performance.now()if((curr-start)>=tick||start==null){if(!isStart){return}if(lockElKey&&!document.querySelector('#'+lockElKey)){stopHandle()return}if(handle){try{if(handle()){stopHandle()return}}catch(e){stopHandle()console.log(e)}}start=curr}requestKey=requestAnimationFrame(loop)}conststartHandle=(p_handle)=>{stopHandle()isStart=truehandle=p_handle start=nullloop()}conststopHandle=_=>{isStart=falseconsole.log('stop')if(requestKey){cancelAnimationFrame(requestKey)}requestKey=null}return{start:startHandle,stop:stopHandle}}letrenderTat=TickAni(2000)lettoolEl=document.createElement('div')toolEl.style.cssText+=';position:absolute;z-index:5;width:200px;height:400px;overflow:auto;right:20px;top:2px;font-size:12px'document.body.append(toolEl)toolEl.addEventListener('click',function(e){letto_index=e.srcElement.getAttribute('to_index')if(to_index){console.log('to_index',to_index);[...document.querySelectorAll('[data-testid="send_message"] [data-testid = "message_content"]')][to_index].scrollIntoView()}})renderTat.start(_=>{//更新获取最新对话,更新操作容器letchatList=[...document.querySelectorAll('[data-testid="send_message"] [data-testid = "message_content"]')].map(d=>d.innerText)if(chatList.length!=[...toolEl.querySelectorAll('.item')].length){letinnerStr=''for(leti=0;i<chatList.length;i++){innerStr+=`<pre to_index="${i}" class="item" style="max-height: 80px;border:1px solid #ddd;margin:5px;overflow:auto">${chatList[i]}</pre>`}toolEl.innerHTML=innerStr}})
http://www.jsqmd.com/news/615744/

相关文章:

  • FastAPI 数据验证 Pydantic Flask 用 WTForms
  • Infoseek舆情系统决策树:在回应、沉默与引导间寻找最优解
  • OpenClaw+Phi-3-mini-128k-instruct:自动化生成技术博客并发布Hexo
  • 【成本控制生死线】:GraalVM静态镜像内存优化的7个黄金法则——某金融云平台年省$2.8M的真实路径
  • HTML怎么创建课程大纲_HTML章节+课时嵌套结构【方法】
  • 国密 SM4 加密 C 语言嵌入式实现
  • [Linux][虚拟串口]x一个特殊的字节露
  • 带标注信息的交通信号灯识别数据集,可识别左转灯,红绿黄灯,识别率82.88%,支持yolo,coco json,pascal voc xml格式
  • QTableWidget 表格组件渭
  • 如何测试SQL触发器的边界条件_编写单元测试用例模拟场景
  • 老狗科技注塑机数据采集网关:即插即用,兼容100%老旧设备,赋能透明工厂
  • 手把手教你用机乎AI:基于纯AI社交的技术集成指南
  • OpenClaw+千问3.5-35B-A3B-FP8:学术PDF自动摘要与图表解析
  • 大数据开发学习Day8
  • 《四十悟赋》
  • Prodigy宣布推出全球业界功能强大的I3C协议训练器
  • esp-gui:面向ESP32的轻量级嵌入式GUI事件驱动框架
  • WebSerial:基于WebSocket的MCU嵌入式Web终端技术
  • 电商客服+导购智能体的设计与开发豆
  • LangGraph V1.0.5 文档精炼版
  • OpenClaw学习助手:百川2-13B量化模型自动整理课程笔记
  • Springboot 实现多数据源(PostgreSQL 和 SQL Server)连接该
  • AI开发-python-langchain框架(--并行流程 )伪
  • 企业级医疗 IoT 平台实战:实时生命体征系统从单机高并发到云原生流式 AI 的架构演进
  • 力扣396
  • 深度解析:红海云为何成为大中型企业首选HR数字化底座
  • OpenClaw+SecGPT-14B低成本方案:树莓派家庭安全中枢搭建
  • DS18B20多点温度采集驱动库设计与工业应用
  • 打理多个微信不用慌,告别切换内耗很简单
  • 碳纳米管的导电性、导热性到底有多好?