File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ declare module 'chrome-remote-interface' {
14
14
15
15
export interface CdpClient {
16
16
Runtime : {
17
- runIfWaitingForDebugger ( ) : void ;
17
+ runIfWaitingForDebugger ( ) : Promise < void > ;
18
18
enable ( ) : Promise < void > ;
19
19
evaluate ( options : { expression : string } ) : Promise < {
20
20
result ?: unknown ,
@@ -25,7 +25,7 @@ declare module 'chrome-remote-interface' {
25
25
Debugger : {
26
26
enable ( ) : Promise < void > ;
27
27
paused ( callback : ( stack : Stack ) => void ) : void ;
28
- resume ( ) : void ;
28
+ resume ( ) : Promise < void > ;
29
29
evaluateOnCallFrame ( options : {
30
30
callFrameId : string ,
31
31
expression : string
Original file line number Diff line number Diff line change @@ -101,12 +101,14 @@ export class ElectronInterceptor implements Interceptor {
101
101
} ) ;
102
102
} ) ;
103
103
104
- debugClient . Runtime . runIfWaitingForDebugger ( ) ;
104
+ await debugClient . Runtime . runIfWaitingForDebugger ( ) ;
105
105
await debugClient . Runtime . enable ( ) ;
106
106
await debugClient . Debugger . enable ( ) ;
107
107
108
108
const callFrameId = await callFramePromise ;
109
109
110
+ console . log ( "Injecting interception settings into Electron app..." ) ;
111
+
110
112
// Inside the Electron process, load our electron-intercepting JS.
111
113
const injectionResult = await debugClient . Debugger . evaluateOnCallFrame ( {
112
114
expression : `require(${
@@ -130,7 +132,9 @@ export class ElectronInterceptor implements Interceptor {
130
132
throw new Error ( "Failed to inject into Electron app" ) ;
131
133
}
132
134
133
- debugClient . Debugger . resume ( ) ;
135
+ console . log ( "App intercepted, resuming..." ) ;
136
+ await debugClient . Debugger . resume ( ) ;
137
+ console . log ( "App resumed, Electron interception complete" ) ;
134
138
}
135
139
136
140
async deactivate ( proxyPort : number | string ) : Promise < void > {
You can’t perform that action at this time.
0 commit comments