Skip to content

refactor: remove unused newTab() and closeTab() from IPage#709

Merged
jackwener merged 1 commit intomainfrom
refactor/remove-unused-tab-methods
Apr 2, 2026
Merged

refactor: remove unused newTab() and closeTab() from IPage#709
jackwener merged 1 commit intomainfrom
refactor/remove-unused-tab-methods

Conversation

@jackwener
Copy link
Copy Markdown
Owner

Summary

  • Remove newTab() and closeTab() from the IPage interface, BasePage abstract class, and both implementations (Page, CDPPage)
  • Remove corresponding test mocks from 14 test files
  • Zero production callers existed for either method — they were only referenced in test mocks

What's kept

  • selectTab() and tabs() — have active production usage (e.g. doubao adapter)
  • scoreTarget about:blank penalty — defensive measure against user-opened blank tabs
  • Extension op: 'new' handler — keeps extension API complete

Verification

  • tsc --noEmit passes
  • All unit tests pass (46/46 for affected files)
  • Pre-existing e2e/smoke failures unrelated to this change

Test plan

  • npx tsc --noEmit passes
  • Unit tests for affected files pass
  • Verified no production code calls newTab() or closeTab()
  • Verified selectTab() and tabs() still have production callers

Both methods had zero production callers — only test mocks referenced them.
newTab() created about:blank pages via CDP Target.createTarget, but no
adapter or pipeline step ever invoked it. closeTab() was similarly unused.

selectTab() and tabs() are kept as they have active production usage
(e.g. doubao adapter). The scoreTarget about:blank penalty is retained
as a defensive measure against user-opened blank tabs.
@jackwener jackwener merged commit d7d5211 into main Apr 2, 2026
11 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.

1 participant