From: Cheng Zhao Date: Wed, 24 Sep 2014 05:23:37 +0000 (+0800) Subject: Fix __dirname and __filename in asar: protocol. X-Git-Tag: v0.17.0~6^2~45 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=b6cded379e6454fa09a038aa472f2eb0effd643a;p=electron.git Fix __dirname and __filename in asar: protocol. --- diff --git a/atom/renderer/lib/init.coffee b/atom/renderer/lib/init.coffee index 94d8679c..5ae2e11a 100644 --- a/atom/renderer/lib/init.coffee +++ b/atom/renderer/lib/init.coffee @@ -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