]> khamidou — GitHub mirrors - electron.git/commitdiff
Should decode when setting __filename from location.
authorCheng Zhao <zcbenz@gmail.com>
Fri, 24 Jan 2014 13:20:30 +0000 (21:20 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Fri, 24 Jan 2014 13:20:30 +0000 (21:20 +0800)
renderer/lib/init.coffee

index 230529d39baa49b3cdc997376459e24e1dfeef9a..8c061149cd460ca99f953db4804c7beb189d4ae3 100644 (file)
@@ -25,11 +25,12 @@ global.module = module
 
 # Set the __filename to the path of html file if it's file:// protocol.
 if window.location.protocol is 'file:'
-  global.__filename =
+  pathname =
     if process.platform is 'win32'
       window.location.pathname.substr 1
     else
       window.location.pathname
+  global.__filename = decodeURIComponent pathname
   global.__dirname = path.dirname global.__filename
 
   # Set module's filename so relative require can work as expected.