I am trying to pause all tab's execution using Chrome DevTools protocol. For that I iterate over all the tabs to get the CDP client for each tab and then send a request to pause JS on every tab. I see it resolve for some tabs properly but not all of them. Any reason this would be happening?
Code that I am using to pause and wait for paused event to get fired:
await client.send(`Debugger.enable`)
new Promise(resolve => {
client.on(`Debugger.paused`, resolve)
client.send(`Debugger.pause`),
})