Commit f5a7460
Fix Extensions.triggerAction: capture parent session before tab detaches
Tab targets are filtered out via SilentDetachAsync which removes them from
Connection._sessions. When CdpPage is constructed shortly after, its call to
client.ParentSession can no longer find the tab session by ID, causing
TabId to fall back to the page target ID instead of the tab target ID.
Chrome then rejects Extensions.triggerAction with "Action can only be
triggered on a tab target."
Fix: capture the parent session object reference at session-creation time
(before SilentDetachAsync runs) so CdpPage always gets the correct tab
target ID regardless of session lifecycle.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>1 parent f0f7dc2 commit f5a7460
2 files changed
Lines changed: 10 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | | - | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| 52 | + | |
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
55 | 57 | | |
56 | 58 | | |
57 | | - | |
| 59 | + | |
| 60 | + | |
58 | 61 | | |
59 | 62 | | |
60 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
332 | | - | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
333 | 337 | | |
334 | 338 | | |
335 | 339 | | |
| |||
0 commit comments