]> khamidou — GitHub mirrors - electron.git/commitdiff
Fix __dirname for page in asar package
authorCheng Zhao <zcbenz@gmail.com>
Tue, 14 Oct 2014 11:27:47 +0000 (19:27 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Tue, 14 Oct 2014 11:27:47 +0000 (19:27 +0800)
Fixes #694.

atom/renderer/lib/init.coffee

index 3fb4ceaabf42d66f974da941255b0c3d0d3a3fe1..a6f571b213cd485a2800fdeab5c771877905af7a 100644 (file)
@@ -31,7 +31,7 @@ window.addEventListener 'unload', ->
 # Set the __filename to the path of html file if it's file: or asar: protocol.
 if window.location.protocol in ['file:', 'asar:']
   pathname =
-    if process.platform is 'win32'
+    if process.platform is 'win32' and window.location.pathname[0] is '/'
       window.location.pathname.substr 1
     else
       window.location.pathname