11import * as _ from 'lodash' ;
22import { spawn } from 'child_process' ;
33import * as util from 'util' ;
4+ import * as path from 'path' ;
45import * as fs from 'fs' ;
56
67import { getPortPromise as getPort } from 'portfinder' ;
@@ -11,7 +12,7 @@ import { Interceptor } from '.';
1112
1213import { HtkConfig } from '../config' ;
1314import { delay } from '../util' ;
14- import { getTerminalEnvVars } from './terminal/terminal-env-overrides' ;
15+ import { getTerminalEnvVars , OVERRIDES_DIR } from './terminal/terminal-env-overrides' ;
1516import { reportError , addBreadcrumb } from '../error-tracking' ;
1617import { findExecutableInApp } from '@httptoolkit/osx-find-executable' ;
1718
@@ -24,7 +25,7 @@ const isAppBundle = (path: string) => {
2425
2526export class ElectronInterceptor implements Interceptor {
2627 readonly id = 'electron' ;
27- readonly version = '1.0.0 ' ;
28+ readonly version = '1.0.1 ' ;
2829
2930 private debugClients : {
3031 [ port : string ] : Array < ChromeRemoteInterface . CdpClient >
@@ -98,8 +99,7 @@ export class ElectronInterceptor implements Interceptor {
9899 // Inside the Electron process, load our electron-intercepting JS.
99100 const injectionResult = await debugClient . Debugger . evaluateOnCallFrame ( {
100101 expression : `require("${
101- // Need to escape slashes to ensure this works on Windows (where all paths have backslashes)
102- require . resolve ( '../../overrides/js/prepend-electron.js' ) . replace ( / \\ / g, '\\\\' )
102+ path . join ( OVERRIDES_DIR , 'js' , 'prepend-electron.js' )
103103 } ")({
104104 newlineEncodedCertData: "${ ( await this . certData ) . replace ( / \r \n | \r | \n / g, '\\n' ) } ",
105105 spkiFingerprint: "${ generateSPKIFingerprint ( await this . certData ) } "
0 commit comments