We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 98662fa commit 72ca5b5Copy full SHA for 72ca5b5
src/renderer/shell_content_renderer_client.cc
@@ -211,12 +211,15 @@ void ShellContentRendererClient::InstallNodeSymbols(
211
if (use_node) {
212
v8::Local<v8::Script> script = v8::Script::New(v8::String::New(
213
// Make node's relative modules work
214
+ "if (!process.mainModule.filename) {"
215
#if defined(OS_WIN)
216
"process.mainModule.filename = decodeURIComponent(window.location.pathname.substr(1));"
217
#else
218
"process.mainModule.filename = decodeURIComponent(window.location.pathname);"
219
#endif
220
"process.mainModule.paths = global.require('module')._nodeModulePaths(process.cwd());"
221
+ "process.mainModule.loaded = true;"
222
+ "}"
223
));
224
script->Run();
225
}
0 commit comments