From: Cheng Zhao Date: Tue, 17 Dec 2013 14:16:15 +0000 (+0800) Subject: Fix __filename on Windows. X-Git-Tag: v0.8.0~4^2~12 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=c04a9933cc9f8f72fb4680e9cd5e7a998f9c6e9f;p=electron.git Fix __filename on Windows. --- diff --git a/renderer/lib/init.coffee b/renderer/lib/init.coffee index 5265b4d8..198801fe 100644 --- a/renderer/lib/init.coffee +++ b/renderer/lib/init.coffee @@ -39,7 +39,11 @@ global.clearImmediate = timers.clearImmediate # Set the __filename to the path of html file if it's file:// protocol. if window.location.protocol is 'file:' - global.__filename = window.location.pathname + global.__filename = + if process.platform is 'win32' + window.location.pathname.substr 1 + else + window.location.pathname global.__dirname = path.dirname global.__filename # Also search for module under the html file.