Repository navigation
feat(browser): 新增通用输入层与剪贴板/文件工具 - #18
Merged
Merged
Conversation
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.
概述 / Summary
浏览器工具从「按编号点击/输入」扩展为一层通用输入能力:指针手势与坐标、组合键与按住、光标插入与逐键输入、剪贴板(文本/富文本)、文件上传、单 iframe 精读;并新增
browser_clipboard/browser_upload两个工具。动机 / Motivation
富文本编辑器、画布/SVG 白板、代码编辑器和拖拽界面没有语义角色,快照清单点不到;原
browser_press只有单键且是合成事件,Cmd+A/Cmd+V不生效;编辑器自持文档模型,直接写 value 会被回滚。缺口是输入原语,不是应用适配。改动内容 / Changes
browser_snapshot(frame、query)、browser_click(selector/point/action/drag/trusted等)、browser_type(selector/mode/trusted)、browser_press(modifiers/actiondown-up/repeat)、browser_scroll(point真实滚轮)、browser_follow_tab(activate)。browser_clipboard(write / paste event / system paste)与browser_upload(宿主侧路径校验 + CDP 设置文件)。chrome.debuggerbroker:devtools 与 input 共用单标签页附加,输入空闲 20s 释放;input 只用Input.*+Emulation.setFocusEmulationEnabled。commands(selectAll/copy/paste/cut/undo/redo);keystrokes 模式保留大写;粘贴事件未被消费时对普通 input 回退插入。follow_tab {activate:true};截图拒绝未聚焦窗口,避免过期帧。测试 / Testing
pnpm run typecheck、pnpm run test(桥 222 + 扩展 700)、pnpm run build、Firefox 构建、pnpm run check:runtime、node scripts/smoke-runtime.mjs全部通过。影响范围 / Impact
clipboardWrite、offscreen权限与离屏剪贴板页;真实输入会附加调试器(显示提示条、该标签页暂不能开 DevTools),空闲自动释放。(synthetic);元素寻址、文本、粘贴事件、query 照常。commands;其它平台行为不变。Checklist
pnpm run build/bash -n scripts/install.sh等基础检查 / Passed basic checks