Skip to content

Commit fe2808f

Browse files
committed
Fix bug in Electron interception on Windows
1 parent 4f86543 commit fe2808f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/interceptors/electron.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,10 @@ export class ElectronInterceptor implements Interceptor {
113113

114114
// Inside the Electron process, load our electron-intercepting JS.
115115
const injectionResult = await debugClient.Debugger.evaluateOnCallFrame({
116-
expression: `require("${
117-
path.join(OVERRIDES_DIR, 'js', 'prepend-electron.js')
118-
}")({
116+
expression: `require(${
117+
// Need to stringify to handle chars that need escaping (e.g. windows backslashes)
118+
JSON.stringify(path.join(OVERRIDES_DIR, 'js', 'prepend-electron.js'))
119+
})({
119120
newlineEncodedCertData: "${(await this.certData).replace(/\r\n|\r|\n/g, '\\n')}",
120121
spkiFingerprint: "${generateSPKIFingerprint(await this.certData)}"
121122
})`,

0 commit comments

Comments
 (0)