feat: replace tabId with targetId as cross-layer page identity#899
Open
feat: replace tabId with targetId as cross-layer page identity#899
Conversation
… icons - Remove unused `scripting` permission (Chrome Web Store rejection fix) - Bump version 1.6.7 → 1.6.8 - Redesign icons with neon gradient style (pure SVG paths, glow effect)
Use Chrome CDP targetId (UUID) as the canonical page identity across all layers (extension → daemon → CLI), demoting tabId to an extension-internal routing detail. - Add extension/src/identity.ts: bidirectional targetId ↔ tabId mapping with lazy refresh via chrome.debugger.getTargets() - Update protocol: Command.page and Result.page carry targetId - Update background.ts: resolveCommandTabId() and pageScopedResult() helpers; all page-scoped handlers return targetId - Add sendCommandFull() to daemon-client for responses with page identity - Update Page class: _page stores targetId, goto/selectTab extract it - Update record.ts: injectedPages tracks by targetId - Add extension tests to vitest config and CI test scripts
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
targetId(UUID) as the canonical page identity across all layers (extension → daemon → CLI), demotingtabIdto an extension-internal routing detailidentity.tsmodule for bidirectionaltargetId ↔ tabIdmapping with lazy refresh viachrome.debugger.getTargets()sendCommandFull()to daemon-client for returning page identity alongside response dataChanges
identity.tsresolveTargetId(),resolveTabId(),evictTab(),refreshMappings()protocol.tsCommand.pageandResult.pagefields (targetId)background.tsresolveCommandTabId()+pageScopedResult()helpers; all page-scoped handlers emit targetIddaemon-client.tsDaemonCommand.page,DaemonResult.page, newsendCommandFull()page.ts_pagestores targetId;goto()/selectTab()extract fromsendCommandFull()record.tsinjectedPagestracks by targetId instead of tabIdtypes.tsIPage.getActivePage()returns targetIdvitest.config.tspackage.jsonnpm testincludes--project extensionDesign constraints
pageonly in page-scoped responses — navigate, exec, screenshot, tabs:select, etc.Test plan
npm testand CIopencli runnavigates and returns targetId in page fieldselectTab()updates_pagecorrectly