]> khamidou — GitHub mirrors - electron.git/commitdiff
Fix __dirname and __filename in asar: protocol.
authorCheng Zhao <zcbenz@gmail.com>
Wed, 24 Sep 2014 05:23:37 +0000 (13:23 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Wed, 24 Sep 2014 05:23:37 +0000 (13:23 +0800)
atom/renderer/lib/init.coffee

index 94d8679ca01976d15c9c4f754582352dfadf29bb..5ae2e11a644c8cfe3be7e41890ff99ef8d919b61 100644 (file)
@@ -24,8 +24,8 @@ require path.resolve(__dirname, '..', '..', 'common', 'lib', 'init.js')
 global.require = require
 global.module = module
 
-# Set the __filename to the path of html file if it's file:// protocol.
-if window.location.protocol is 'file:'
+# 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'
       window.location.pathname.substr 1