From: Cheng Zhao Date: Fri, 24 Jan 2014 13:20:30 +0000 (+0800) Subject: Should decode when setting __filename from location. X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=76098255f08a38aa9ae41d72c8247fc82f08504b;p=electron.git Should decode when setting __filename from location. --- diff --git a/renderer/lib/init.coffee b/renderer/lib/init.coffee index 230529d3..8c061149 100644 --- a/renderer/lib/init.coffee +++ b/renderer/lib/init.coffee @@ -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.