]> khamidou — GitHub mirrors - electron.git/commitdiff
Fix __filename on Windows.
authorCheng Zhao <zcbenz@gmail.com>
Tue, 17 Dec 2013 14:16:15 +0000 (22:16 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Tue, 17 Dec 2013 14:16:15 +0000 (22:16 +0800)
renderer/lib/init.coffee

index 5265b4d845f0b9beea298d36945eade31cf5fbeb..198801fe21d65f59995cc8ce306b65a999b6f84d 100644 (file)
@@ -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.