Load the "preload" script in <webview>

This commit is contained in:
Cheng Zhao 2014-11-06 15:13:37 +08:00
parent 8d8bfcd120
commit 217b1afe87
8 changed files with 24 additions and 3 deletions

View file

@ -31,6 +31,8 @@ for arg in process.argv
require('web-frame').setName 'ATOM_SHELL_GUEST_WEB_VIEW'
else if arg.indexOf('--node-integration=') == 0
nodeIntegration = arg.substr arg.indexOf('=') + 1
else if arg.indexOf('--preload-script=') == 0
preloadScript = arg.substr arg.indexOf('=') + 1
if location.protocol is 'chrome-devtools:'
# Override some inspector APIs.
@ -86,3 +88,6 @@ else
delete global.process
delete global.setImmediate
delete global.clearImmediate
# Load the script specfied by the "preload" attribute.
require preloadScript if preloadScript