Skip to content

fix(page-controller): keep _blank link clicks in current tab#441

Open
Gujiassh wants to merge 1 commit intoalibaba:mainfrom
Gujiassh:fix/click-blank-target-same-tab
Open

fix(page-controller): keep _blank link clicks in current tab#441
Gujiassh wants to merge 1 commit intoalibaba:mainfrom
Gujiassh:fix/click-blank-target-same-tab

Conversation

@Gujiassh
Copy link
Copy Markdown
Contributor

Summary

  • make clickElement() handle <a target="_blank"> links in the current tab
  • temporarily switch target to _self for the click, then restore the original target attribute
  • return a message indicating the link was opened in the current tab

Problem

Issue #432 reports that _blank links and cross-tab flows break Page Agent execution.

Validation

  • npx tsc --noEmit -p packages/page-controller/tsconfig.json

Closes #432

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.

page-agent 无法处理 target="_blank" 链接和跨 Tab 场景

1 participant