handle target info changed to change target id
This commit is contained in:
@@ -440,6 +440,24 @@ export async function startPlayWriterCDPRelayServer({ port = 19988, host = '127.
|
|||||||
} as CDPEvent,
|
} as CDPEvent,
|
||||||
source: 'extension'
|
source: 'extension'
|
||||||
})
|
})
|
||||||
|
} else if (method === 'Target.targetInfoChanged') {
|
||||||
|
const infoParams = params as Protocol.Target.TargetInfoChangedEvent
|
||||||
|
const target = connectedTargets.get(sessionId ||'')
|
||||||
|
if (target) {
|
||||||
|
target.targetInfo = infoParams.targetInfo
|
||||||
|
// Update targetId mapping if needed, though usually targetId doesn't change
|
||||||
|
if (target.targetId !== infoParams.targetInfo.targetId) {
|
||||||
|
target.targetId = infoParams.targetInfo.targetId
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sendToPlaywright({
|
||||||
|
message: {
|
||||||
|
method: 'Target.targetInfoChanged',
|
||||||
|
params: infoParams
|
||||||
|
} as CDPEvent,
|
||||||
|
source: 'extension'
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
sendToPlaywright({
|
sendToPlaywright({
|
||||||
message: {
|
message: {
|
||||||
|
|||||||
Reference in New Issue
Block a user