File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ class CDPServer {
2727 const msg = JSON . parse ( message ) ;
2828 const resultMsg : any = {
2929 id : msg . id ,
30+ sessionId : msg . sessionId ,
3031 } ;
3132 console . log ( msg ) ;
3233
@@ -132,6 +133,17 @@ class CDPServer {
132133 }
133134
134135 if ( sessionId ) {
136+ console . log ( "Routing " + method + " to session " + sessionId ) ;
137+
138+ const result : any = await this . callTabMethod ( sessionId , method , params ) ;
139+
140+ if ( result . result ) {
141+ return result . result ;
142+ } else if ( result . error ) {
143+ throw new Error ( result . error . message ) ;
144+ } else {
145+ throw new Error ( "Bad message from subcdp" ) ;
146+ }
135147 }
136148
137149 throw Error ( `${ method } unimplemented` ) ;
@@ -194,8 +206,10 @@ const Scopes = {
194206 } ;
195207 } ,
196208
197- setAutoAttach ( params : Protocol . Target . SetAutoAttachRequest ) {
209+ async setAutoAttach ( params : Protocol . Target . SetAutoAttachRequest ) {
198210 console . log ( "Target.setAutoAttach" , params ) ;
211+
212+ return { } ;
199213 } ,
200214 getTargetInfo (
201215 params : Protocol . Target . GetTargetInfoRequest
You can’t perform that action at this time.
0 commit comments