File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,23 @@ class CDPServer {
8181 const callback = callbacks . get ( msg . id ) ! ;
8282 callback ( msg ) ;
8383 callbacks . delete ( session . messageid ) ;
84+
85+ return ;
86+ }
87+ console . log ( "Forwawrding Evvent" , msg ) ;
88+ if ( msg . params ?. context ) {
89+ msg . params . context . auxData = {
90+ frameId : String ( tab . id ) ,
91+ isDefault : true ,
92+ } ;
8493 }
94+ this . sendMessage (
95+ JSON . stringify ( {
96+ method : msg . method ,
97+ params : msg . params ,
98+ sessionId : sid ,
99+ } )
100+ ) ;
85101 } ;
86102
87103 return sid ;
Original file line number Diff line number Diff line change @@ -180,6 +180,10 @@ function injectChobitsu(client: ScramjetClient, tab: Tab) {
180180 devtoolsScript . setAttribute ( "src" , devtoolsUrl + "/chobitsu_inject.js" ) ;
181181 client . global . document . head . appendChild ( devtoolsScript ) ;
182182
183+ // page needs to know what its id is so it can send to playwright properly
184+ // @ts -expect-error
185+ client . global . $chobitsuPageId = String ( tab . id ) ;
186+
183187 // @ts -expect-error
184188 client . global . $onChobitsuMessage = ( message : string ) => {
185189 if ( tab . onChobitsuMessage ) tab . onChobitsuMessage ( message ) ;
You can’t perform that action at this time.
0 commit comments