mirror of
https://github.com/electron/electron.git
synced 2026-01-24 23:08:10 -05:00
Fix __dirname and __filename in asar: protocol.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user