Skip to content

Handle foreign extension embeds before debugger attach#662

Merged
jackwener merged 6 commits intojackwener:mainfrom
zuogl:fix/extension-attach-conflict
Apr 1, 2026
Merged

Handle foreign extension embeds before debugger attach#662
jackwener merged 6 commits intojackwener:mainfrom
zuogl:fix/extension-attach-conflict

Conversation

@zuogl
Copy link
Copy Markdown
Contributor

@zuogl zuogl commented Apr 1, 2026

Summary

  • add the scripting permission to the Browser Bridge extension
  • remove foreign chrome-extension:// iframe/frame/embed/object nodes before attaching the debugger and retry once after a failed attach
  • keep the extension manifest regression test aligned with the new permission and include the rebuilt extension bundle

Fixes #661
Refs #249
Refs #652

Why

On some Chrome profiles, opencli twitter search could navigate to a normal https://x.com/... tab but still fail at chrome.debugger.attach() with:

attach failed: Cannot access a chrome-extension:// URL of different extension

I reproduced this locally via the daemon command path. The failure appears when another extension injects a chrome-extension://... embed into the target page, which makes the attach step fail even though the top-level tab URL is debuggable.

Validation

  • npm run build in extension/
  • npx vitest run src/extension-manifest-regression.test.ts
  • manual repro + verification with opencli twitter search "claude code" --filter top --limit 10 -f json after reloading the patched extension

@jackwener jackwener merged commit 4818871 into jackwener:main Apr 1, 2026
@jackwener jackwener mentioned this pull request Apr 1, 2026
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.

[Bug]: opencli插件被其他插件影响,无法实现真正的数据获取工作。

2 participants