Skip to content

Commit 8b358d9

Browse files
committed
Merge pull request nwjs#2267 from ghostoy/master
Fix nwjs#2167 on Windows
2 parents 9a78a03 + 01e3b03 commit 8b358d9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/renderer/shell_content_renderer_client.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ void ShellContentRendererClient::SetupNodeUtil(
273273
"if (!process.mainModule.filename || process.mainModule.filename === 'blank') {"
274274
" var root = '" + root_path + "';"
275275
#if defined(OS_WIN)
276-
"process.mainModule.filename = decodeURIComponent(window.location.pathname.substr(1));"
276+
"process.mainModule.filename = decodeURIComponent(window.location.pathname === 'blank' ? 'blank': window.location.pathname.substr(1));"
277277
#else
278278
"process.mainModule.filename = decodeURIComponent(window.location.pathname);"
279279
#endif
@@ -282,7 +282,7 @@ void ShellContentRendererClient::SetupNodeUtil(
282282
"process.mainModule.paths = global.require('module')._nodeModulePaths(process.cwd());"
283283
"process.mainModule.loaded = true;"
284284
"}").c_str()),
285-
v8::String::NewFromUtf8(isolate, "process_main"));
285+
v8::String::NewFromUtf8(isolate, "process_main"));
286286
CHECK(*script);
287287
script->Run();
288288
}

0 commit comments

Comments
 (0)