Skip to content

Commit

Permalink
Use Module._load instead of require for the original asar
Browse files Browse the repository at this point in the history
  • Loading branch information
NotNite committed Dec 10, 2023
1 parent 388417d commit f793192
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/injector/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ export async function inject(asarPath: string) {
logger.error("Failed to inject", e);
}

require(asarPath);
// Need to do this instead of require() or it breaks require.main
// @ts-expect-error why are you not documented
Module._load(asarPath, Module, true);
}

function patchElectron() {
Expand Down

0 comments on commit f793192

Please sign in to comment.