You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hmm, I guess devtools-protocol package is the way?
(Disclaimer: ChatGPT wrote this)
constCDP=require('devtools-protocol');constWebSocket=require('ws');// Replace with the process ID of the Chrome instance you want to targetconstprocessId=1234;// Obtain the WebSocket URL for the instanceconstresp=awaitfetch(`http://localhost:${port}/json/list`);consttargets=awaitresp.json();consttarget=targets.find(t=>t.pid===processId);constwebSocketUrl=target.webSocketDebuggerUrl;// Connect to the instance using the WebSocket URLconstsocket=newWebSocket(webSocketUrl);constclient=newCDP(socket);// Send a message to open a new tabconst{targetId}=awaitclient.send('Target.createTarget',{url: 'https://www.example.com/'});// Wait for a response and print the ID of the newly opened tabconst{frameId}=awaitclient.waitForEvent('Page.frameAttached');console.log(frameId);
I want to open a new tab in an existing window of a
Launcher
instance. Any guidance here would be awesome :)The text was updated successfully, but these errors were encountered: