[CN] feat: 添加底部版本号显示 (v0.6.3)#5
Open
firebear wants to merge 22 commits into
Open
Conversation
## 新增功能 - ✅ 完整集成DeepSeek平台(国产大模型) - ✅ 消息自动填入到DeepSeek输入框 - ✅ 响应自动捕获和同步 - ✅ 发送按钮高亮提示(需手动点击) - ✅ UI完整集成(侧边栏、@提及、讨论模式) ## 修改文件 - manifest.json: 版本0.3.0,添加DeepSeek权限 - content/deepseek.js: 新增DeepSeek适配脚本 - sidepanel/panel.html: 添加DeepSeek UI元素 - sidepanel/panel.js: 添加DeepSeek到AI类型列表 - background.js: 添加DeepSeek URL模式 - README.md: 更新文档,说明DeepSeek支持 ## 新增文档 - 版本日志.md: 记录v0.2.0到v0.3.0的完整开发历程 - 添加国产大模型指南.md: 技术实现指南 - 重新加载指南.md: 用户安装和调试指南 ## 注意事项 - DeepSeek采用手动点击模式(技术限制) - 其他平台保持完全自动化支持 - 清理了所有调试代码,优化了用户体验 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
## 重大更新 - ✅ 新增Kimi(月之暗面)完整支持 - ✅ 新增ChatGLM(智谱AI)完整支持 - ✅ 新增通义千问(阿里)完整支持 - ✅ 支持7个AI平台同时协作(3个国际 + 4个国产) ## 新增文件 - content/kimi.js - Kimi平台适配脚本 - content/chatglm.js - ChatGLM平台适配脚本 - content/qwen.js - 通义千问平台适配脚本 ## 修改文件 - manifest.json: 版本0.4.0,添加3个新平台权限和content_scripts - sidepanel/panel.html: 添加3个新平台UI(目标选择、@提及、讨论模式) - sidepanel/panel.js: 添加3个新平台到AI_TYPES,更新URL检测和mention pattern - background.js: 添加3个新平台URL模式和存储 - README.md: 更新文档,说明7个平台支持 - 版本日志.md: 记录v0.4.0更新 ## 支持平台 国际AI: Claude, ChatGPT, Gemini 国产AI: DeepSeek, Kimi, ChatGLM, 通义千问 ## 技术亮点 - 基于DeepSeek的成功模式快速复用 - 通用化选择器,适配多种国产AI - 完整的UI集成(普通模式、@提及、讨论模式) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
## 问题 - Kimi重定向到 https://www.kimi.com - 插件配置的是 https://kimi.moonshot.cn - 导致无法识别Kimi标签页 ## 修复 - manifest.json: 添加 https://www.kimi.com/* 到host_permissions和content_scripts - background.js: 添加 www.kimi.com 到AI_URL_PATTERNS - panel.js: 更新getAITypeFromUrl函数,同时支持两个Kimi域名 ## 影响 - 现在可以正确识别 https://www.kimi.com 和 https://kimi.moonshot.cn - 修复了"No kimi tab found"错误 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
## 问题 - Kimi使用div[contenteditable]作为输入框(非textarea) - 输入框class为"chat-input-editor" - 使用Lexical编辑器框架 - 原有选择器无法正确定位Kimi输入框 ## 修复 - 更新kimi.js的输入框选择器 - 添加Kimi特定的class选择器:div.chat-input-editor - 添加Lexical编辑器属性:data-lexical-editor="true" - 优化contenteditable div的定位逻辑 ## 新选择器 1. div.chat-input-editor[contenteditable="true"] 2. div[contenteditable="true"][data-lexical-editor="true"] 3. div[role="textbox"][contenteditable="true"] 4. div[contenteditable="true"].chat-input-editor Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
## 问题 - Kimi显示connected,但消息无法填入 - 需要更详细的调试信息定位问题 ## 更新 - 添加输入框查找过程的详细日志 - 添加消息填入过程的详细日志 - 添加更多选择器变体(部分class匹配) - 改进contenteditable的处理逻辑 ## 调试日志 现在会输出: 1. 每个选择器的测试结果 2. 找到的输入框信息 3. 文本填入前后的内容 4. 事件触发情况 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
## 问题
- Kimi使用Lexical编辑器,有自己的状态管理
- 设置textContent会被Lexical立即重置
- 传统的事件触发无法让Lexical识别文本
## 解决方案
采用双重策略:
1. **主要方法**: Clipboard API + paste事件
- 复制文本到剪贴板
- 触发paste事件
- 调用document.execCommand('paste')
2. **Fallback方法**: 模拟键盘输入
- 使用document.execCommand('insertText')
- 逐字符模拟键盘事件
- 10ms延迟模拟真实输入
## 技术细节
- Clipboard API: navigator.clipboard.write + ClipboardItem
- Paste事件: ClipboardEvent with dataType='text/plain'
- 模拟输入: keydown + insertText + keyup序列
- 保持向后兼容:textarea仍使用原方法
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
## 问题 - 文本已成功填入Kimi输入框 - 但发送按钮无法自动点击 ## 解决方案 - 添加Kimi特定的发送按钮选择器 - 支持SVG图标的点击(找到父容器点击) - 添加多种点击方法(container.click + SVG.click + 鼠标事件) - 添加详细的调试日志 ## 新选择器 1. div.send-button-container:not(.disabled) svg.send-icon 2. div.send-button-container svg.send-icon ## 点击策略 如果是SVG按钮: 1. 点击父容器 2. 点击SVG本身 3. 在父容器上触发完整的鼠标事件序列 如果点击失败,按钮会高亮3秒提示用户手动点击 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
## 问题 - ChatGLM消息填入成功 - 但发送按钮无法自动点击 ## 更新 - 添加ChatGLM发送按钮查找的详细日志 - 添加SVG按钮的处理逻辑(参考Kimi) - 改进点击方法(container.click + SVG.click + 鼠标事件) - 添加更多选择器(svg[class*="send"]) ## 调试日志 现在会输出: 1. 每个选择器的测试结果 2. 找到的发送按钮信息 3. 点击方法执行过程 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
## 问题 - ChatGLM发送按钮无法找到 - 所有选择器都返回Not found - 找到0个潜在按钮元素 ## ChatGLM按钮结构 ```html <div class="enter-icon-container"> <img class="enter_icon" src="/img/send.c0c64800.svg"> </div> ``` ## 解决方案 - 添加ChatGLM特定选择器:div.enter-icon-container img.enter_icon - 添加部分class匹配:div[class*="enter-icon"] - 处理img元素:找到img后返回其容器div - 扩展fallback选择器:包含img[src*="send"] ## 新选择器 1. div.enter-icon-container:not(.empty) img.enter_icon 2. div.enter-icon-container img.enter_icon 3. div[class*="enter-icon"] img[src*="send"] 4. div.enter-icon-container ## 逻辑 如果找到img元素,返回其父容器div.enter-icon-container Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
## 问题 - 通义千问重定向到 https://www.qianwen.com/ - 插件配置的是 https://tongyi.aliyun.com - 导致无法识别通义千问标签页 ## 修复 - manifest.json: 添加 www.qianwen.com 到host_permissions和content_scripts - background.js: 添加 www.qianwen.com 到AI_URL_PATTERNS - panel.js: 更新getAITypeFromUrl支持qianwen.com - qwen.js: 添加输入框查找调试日志 - 添加更多placeholder选择器("向通义提问"、"发给通义千问") ## URL支持 现在同时支持两个域名: - https://tongyi.aliyun.com/* - https://www.qianwen.com/* Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
## 问题
- 通义千问输入框已找到
- 但发送按钮无法找到
- 所有通用选择器都返回Not found
## 通义千问按钮结构
```html
<div class="operateBtn-JsB9e2">
<span data-icon-type="qwpcicon-sendChat">
<svg>
<use xlink:href="#qwpcicon-sendChat"></use>
</svg>
</span>
</div>
```
## 解决方案
- 添加通义千问特定选择器
- span[data-icon-type="qwpcicon-sendChat"]
- svg use[xlink:href="#qwpcicon-sendChat"]
- div[class*="operateBtn"]
- 处理SVG USE/SPAN元素,返回其容器div
## 新逻辑
如果找到USE/SVG/SPAN元素,自动返回其父容器div.operateBtn-*
## 修复
- 移除TypeScript语法 (btn as any)
- 使用标准JavaScript: btn.dataset
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- 移除所有 console.log 调试语句 - 保留 console.error 错误日志 - 更新版本号到 0.5.0 - 优化代码可读性和生产环境适用性 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- 更新README版本号到0.5.0 - 完善版本日志,记录完整开发历程 - 更新支持平台状态(全部测试通过) - 添加技术亮点说明 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- 添加针对DeepSeek特定class的选择器(ds-icon-button) - 实现6种自动点击方法: 1. Focus + Enter键(利用tabindex="0") 2. Focus + Space键 3. 标准click()方法 4. 完整鼠标事件序列(mouseenter/over/move/down/up/click) 5. 点击内部SVG元素 6. Pointer Events(pointerdown/pointerup) - 保留手动点击高亮提示作为后备方案 测试版本:v0.5.1 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
新增7种高级方法: 1. 访问React内部props(__react等属性) 2. 遍历React Fiber树查找onClick 3. Focus + Enter键(带isTrusted标志) 4. 点击父元素和所有子元素 5. 标准click()方法 6. 完整鼠标事件(模拟isTrusted) 7. 通过HTMLElement原型调用click 添加详细调试日志: - 输出按钮元素信息和属性 - 显示找到的React内部属性 - 记录每个方法的执行情况 目标:通过分析React内部结构找到正确的事件触发方式 测试版本:v0.5.2 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
基于调试发现DeepSeek不使用React,改用标准聊天快捷键 新的发送策略: 1. 优先:在输入框触发Enter键(大多数聊天应用支持) 2. 备选:点击发送按钮(7种方法) 3. 最终:高亮提示手动点击 优势: - Enter键是聊天应用的标准快捷键 - 绕过了发送按钮的事件系统 - 更简单可靠 测试版本:v0.5.3 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
重大改进: 1. 优化大模型列表顺序 - 国产AI优先:DeepSeek、Kimi、ChatGLM、通义千问 - 国际AI在后:Claude、ChatGPT、Gemini - 3处位置统一调整(普通模式、@按钮、讨论模式) 2. 修改默认勾选 - 普通模式:默认勾选DeepSeek和Kimi - 讨论模式:默认勾选DeepSeek和Kimi 3. 添加品牌主色 - DeepSeek: #4D6BFE (科技蓝) - Kimi: #1677FF (天蓝) - ChatGLM: #52C41A (成功绿) - 通义千问: #722ED1 (品牌紫) - 已有颜色:Claude、ChatGPT、Gemini 4. DeepSeek自动发送成功 - 使用Enter键在输入框发送(标准聊天快捷键) - 清理所有调试代码 - 完全自动化支持 版本:v0.5.4 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- 更新版本日志,记录DeepSeek自动发送成功 - 更新README,说明所有7个平台都是完全自动化 - 移除DeepSeek手动点击的相关说明 - 添加UI优化和品牌色的说明 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
重大改进: ✅ 一键连接功能 - 每个AI模型旁边增加"连接"按钮 - 点击自动在新标签页打开对应AI平台 - 自动检测连接状态并更新UI - 连接成功后显示"✅ 已连接" ✅ 新手引导优化 - 添加首次使用提示条(蓝色闪烁) - 提示用户:"点击下方的'连接'按钮打开AI平台" - 连接成功后自动隐藏提示 ✅ 智能状态管理 - 实时监听标签页打开和切换 - 页面加载完成自动检测AI平台 - 3种状态:未连接、连接中、已连接 ✅ 用户体验提升 - 解决新用户不知道要先打开AI页面的问题 - 无需手动输入URL - 自动化连接流程 版本:v0.6.0 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
问题描述: 如果先打开AI平台标签页,然后关闭,插件仍显示"已连接"状态 解决方案: ✅ 监听标签页关闭事件 (chrome.tabs.onRemoved) ✅ 实时检查所有AI连接状态 ✅ 自动更新为"未连接"状态 ✅ 显示断开连接的日志提示 实现细节: - checkAllAIConnections() 函数 - 遍历所有打开的标签页 - 检查每个AI是否还有打开的标签 - 更新连接状态和UI 用户体验提升: - 连接状态实时准确 - 关闭标签后立即更新 - 提供断开连接的明确反馈 版本:v0.6.1 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
问题描述: 在同一标签页中先打开AI平台A,再导航到AI平台B, 插件错误地显示A和B都是"已连接"状态 解决方案: ✅ 使用 tabToAiMap 精确跟踪每个标签页的AI类型 ✅ 标签页导航时清除旧AI的连接状态 ✅ 标签页关闭时检查是否还有其他该AI的标签页 ✅ 实时准确的连接状态管理 实现细节: - 维护 tabId -> aiType 的映射表 - 标签页更新时检查是否导航到新AI - 如果导航,清除旧AI连接状态,设置新AI连接状态 - 标签页关闭时智能判断是否断开连接 技术改进: - 移除了 checkAllAIConnections() 函数(不再需要) - 使用 Map 数据结构精确跟踪 - 避免了全量扫描所有标签页 - 性能更好,逻辑更清晰 用户体验提升: - 连接状态始终准确 - 标签页导航时自动更新 - 日志提示更明确("标签页导航" vs "标签页已关闭") 版本:v0.6.2 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- 在页面底部添加版本号显示 - 使用 monospace 字体展示版本号 - 自动从 manifest.json 读取版本号 - 优化底部布局(左右对齐) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
为 AI 圆桌中国版添加底部版本号显示功能,提升用户体验和版本透明度。
主要改动
文件变更
sidepanel/panel.html: 添加版本号显示容器sidepanel/panel.css: 添加底部布局和版本号样式sidepanel/panel.js: 添加动态版本号加载函数manifest.json: 版本号更新至 0.6.3截图
底部现在会显示:
© AXTONLIU™ & AI 精英学院™ v0.6.3测试
已在本地测试通过,版本号正确显示在底部右侧。
🤖 Generated with Claude Code