Cleanup usaages of asar: protocol
This commit is contained in:
parent
37d278de34
commit
23b5c1f782
3 changed files with 4 additions and 4 deletions
|
@ -60,8 +60,8 @@ if nodeIntegration in ['true', 'all', 'except-iframe', 'manual-enable-iframe']
|
||||||
global.require = require
|
global.require = require
|
||||||
global.module = module
|
global.module = module
|
||||||
|
|
||||||
# Set the __filename to the path of html file if it's file: or asar: protocol.
|
# Set the __filename to the path of html file if it is file: protocol.
|
||||||
if window.location.protocol in ['file:', 'asar:']
|
if window.location.protocol is 'file:'
|
||||||
pathname =
|
pathname =
|
||||||
if process.platform is 'win32' and window.location.pathname[0] is '/'
|
if process.platform is 'win32' and window.location.pathname[0] is '/'
|
||||||
window.location.pathname.substr 1
|
window.location.pathname.substr 1
|
||||||
|
|
|
@ -179,7 +179,7 @@ class PreloadAttribute extends WebViewAttribute
|
||||||
return '' unless @webViewImpl.webviewNode.hasAttribute @name
|
return '' unless @webViewImpl.webviewNode.hasAttribute @name
|
||||||
preload = resolveUrl @webViewImpl.webviewNode.getAttribute(@name)
|
preload = resolveUrl @webViewImpl.webviewNode.getAttribute(@name)
|
||||||
protocol = preload.substr 0, 5
|
protocol = preload.substr 0, 5
|
||||||
unless protocol in ['file:', 'asar:']
|
unless protocol is 'file:'
|
||||||
console.error webViewConstants.ERROR_MSG_INVALID_PRELOAD_ATTRIBUTE
|
console.error webViewConstants.ERROR_MSG_INVALID_PRELOAD_ATTRIBUTE
|
||||||
preload = ''
|
preload = ''
|
||||||
preload
|
preload
|
||||||
|
|
|
@ -23,4 +23,4 @@ module.exports =
|
||||||
ERROR_MSG_CANNOT_INJECT_SCRIPT: '<webview>: ' +
|
ERROR_MSG_CANNOT_INJECT_SCRIPT: '<webview>: ' +
|
||||||
'Script cannot be injected into content until the page has loaded.'
|
'Script cannot be injected into content until the page has loaded.'
|
||||||
ERROR_MSG_INVALID_PARTITION_ATTRIBUTE: 'Invalid partition attribute.'
|
ERROR_MSG_INVALID_PARTITION_ATTRIBUTE: 'Invalid partition attribute.'
|
||||||
ERROR_MSG_INVALID_PRELOAD_ATTRIBUTE: 'Only "file:" or "asar:" protocol is supported in "preload" attribute.'
|
ERROR_MSG_INVALID_PRELOAD_ATTRIBUTE: 'Only "file:" protocol is supported in "preload" attribute.'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue