mirror of
https://github.com/electron/electron.git
synced 2026-01-25 23:38:18 -05:00
Should decode when setting __filename from location.
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user