Add option to override webview security

This commit is contained in:
Hari Krishna Reddy Juturu 2017-05-06 22:10:42 -07:00
parent b4a8ed01f1
commit 94d054cf11
7 changed files with 64 additions and 2 deletions

View file

@ -57,6 +57,7 @@ let nodeIntegration = 'false'
let preloadScript = null
let isBackgroundPage = false
let appPath = null
let enableWebView = false
for (let arg of process.argv) {
if (arg.indexOf('--guest-instance-id=') === 0) {
// This is a guest web view.
@ -72,6 +73,8 @@ for (let arg of process.argv) {
isBackgroundPage = true
} else if (arg.indexOf('--app-path=') === 0) {
appPath = arg.substr(arg.indexOf('=') + 1)
} else if (arg.indexOf('--enable-webview-override=') === 0) {
enableWebView = arg.substr(arg.indexOf('=') + 1)
}
}
@ -94,7 +97,7 @@ if (window.location.protocol === 'chrome-devtools:') {
require('./content-scripts-injector')
// Load webview tag implementation.
if (process.guestInstanceId == null) {
if ((nodeIntegration === 'true' || enableWebView === 'true') && process.guestInstanceId == null) {
require('./web-view/web-view')
require('./web-view/web-view-attributes')
}