Skip to content

fix(bsk): support full-page screenshots of controlled background tabs | 支持受控后台标签页的整页截图 - #253

Merged
iuyo5678 merged 5 commits into
mainfrom
fix/background-full-page-screenshots
Sep 18, 2026
Merged

iuyo5678 merged 5 commits into
mainfrom
fix/background-full-page-screenshots

Conversation

@Ljy-0827

Copy link
Copy Markdown
Collaborator

问题

--no-focus 会话中,通过 --no-active 创建的受控标签页已经可以执行任务和获取视口截图,但整页截图仍要求目标处于激活状态,并在用户切换到其他标签时取消。

原整页捕获优先使用窗口截图。如果仅移除激活限制,可能截到窗口中其他标签的内容。

修改

  • Agent 整页截图统一使用目标标签的 CDP 捕获,不再回退到窗口截图。
  • 移除 Agent 路径的激活要求,允许目标始终处于后台;用户切换其他标签不会取消截图。
  • 整次任务固定文档和 debugger attachment,并持续校验控制关系;导航、连接更替或控制权丢失后中止,编码完成后再次校验,避免发布失效结果。
  • 修正分数缩放下整数视口尺寸丢失精度的问题,避免正常截图被误判为尺寸变化。
  • 更新使用说明及回归测试。

实现边界

复用现有滚动、分片拼接、懒加载处理、固定元素处理、取消和恢复机制,没有重新实现长截图功能。

不新增标签激活或窗口聚焦操作。Quick Actions 的捕获后端和激活规则保持不变;CLI、协议及后台执行生命周期不变。

验证

  • 扩展测试:1709 passed / 97 skipped。
  • TypeScript、Biome、生产构建及 diff 检查通过。
  • 真实 bsk:两个未激活目标的整页 PNG、懒加载内容、目标像素及滚动位置恢复通过。
  • 隔离 Chrome:普通比例与高 DPI/125% 缩放回归通过。
  • Quick Actions:两档既有逐行像素及恢复回归通过。

测试 Chrome 存在启动超时,最终部分浏览器验证临时延长了测试启动等待,运行后已恢复,未修改产品超时。真实 bsk 使用步骤级 active 状态采样;隔离 headless 回归检查了原生激活和焦点事件。

Refs #230

@Ljy-0827
Ljy-0827 added this pull request to stack #251 September 15, 2026 07:38
@Ljy-0827
Ljy-0827 force-pushed the fix/background-tab-screenshots branch from 6cb6937 to 4015dd3 Compare September 15, 2026 09:40
@Ljy-0827
Ljy-0827 force-pushed the fix/background-full-page-screenshots branch from 9e0a5fb to cfdbdcc Compare September 15, 2026 09:48
@Ljy-0827

Copy link
Copy Markdown
Collaborator Author

修复全页截图重复捕获 overlay scrollbar

  • 问题: macOS Chrome 的 overlay scrollbar 会在分片滚动时显示,并被捕获到各个视口截图中,导致拼接后的长图右侧出现多个重复滑块。由于这类滚动条不占布局空间,现有滚动条区域裁剪无法将其排除。
  • 修复: 在共享全页截图的准备阶段,仅当根视口两轴均无滚动条占位时,临时隐藏根滚动条;完成、取消或异常退出时,通过已有清理机制恢复原样式及优先级。保留传统滚动条的占位与裁剪行为,不影响内部滚动容器,不修改拼接算法或后台执行策略。
  • 验证: 补充样式恢复单测和浏览器边缘像素回归。真实 macOS Chrome 中,从同一后台标签页的两个不同滚动位置连续截图,均无重复滑块,滚动位置和样式恢复正确,视口尺寸保持不变。

@Ljy-0827
Ljy-0827 force-pushed the fix/background-tab-screenshots branch from 4015dd3 to b36041d Compare September 15, 2026 11:21
@Ljy-0827
Ljy-0827 force-pushed the fix/background-full-page-screenshots branch from ba9a152 to b3a07a1 Compare September 15, 2026 11:24
@Ljy-0827
Ljy-0827 marked this pull request as ready for review September 15, 2026 11:24
@Ljy-0827
Ljy-0827 force-pushed the fix/background-tab-screenshots branch from b36041d to 5537ab3 Compare September 16, 2026 03:05
@Ljy-0827
Ljy-0827 force-pushed the fix/background-full-page-screenshots branch from b3a07a1 to 61fb59c Compare September 16, 2026 03:09
@Ljy-0827
Ljy-0827 force-pushed the fix/background-tab-screenshots branch 2 times, most recently from 36c4119 to 4e7fceb Compare September 16, 2026 07:13
@Ljy-0827
Ljy-0827 force-pushed the fix/background-full-page-screenshots branch from 61fb59c to f613cf7 Compare September 16, 2026 07:15
@Ljy-0827
Ljy-0827 force-pushed the fix/background-tab-screenshots branch from 4e7fceb to 803482b Compare September 17, 2026 07:47
@Ljy-0827
Ljy-0827 removed this pull request from stack #251 September 17, 2026 08:03
@Ljy-0827
Ljy-0827 marked this pull request as draft September 17, 2026 08:03
@Ljy-0827
Ljy-0827 changed the base branch from fix/background-tab-screenshots to fix/background-tab-execution September 17, 2026 08:15
@Ljy-0827
Ljy-0827 force-pushed the fix/background-full-page-screenshots branch from f613cf7 to a7540c3 Compare September 17, 2026 08:21
@Ljy-0827
Ljy-0827 marked this pull request as ready for review September 17, 2026 08:32
@iuyo5678
iuyo5678 changed the base branch from fix/background-tab-execution to main September 18, 2026 13:03
Preserve the streamlined skill workflow and document background support for both viewport and full-page screenshots. Keep Canvas capture guidance and remove the outdated visibility requirement for Agent full-page capture.
@iuyo5678
iuyo5678 merged commit fa953dc into main Sep 18, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants