From 3fed5e6946b77361decb6f3a0ea2bce6967d52f1 Mon Sep 17 00:00:00 2001 From: bridiver Date: Fri, 15 Jan 2016 10:08:02 -0700 Subject: [PATCH] add webview settings for secure display and running of content --- atom/browser/lib/guest-view-manager.coffee | 2 ++ atom/renderer/lib/web-view/web-view-attributes.coffee | 2 ++ atom/renderer/lib/web-view/web-view-constants.coffee | 2 ++ 3 files changed, 6 insertions(+) diff --git a/atom/browser/lib/guest-view-manager.coffee b/atom/browser/lib/guest-view-manager.coffee index 5e1c8363d7..e84cc48f05 100644 --- a/atom/browser/lib/guest-view-manager.coffee +++ b/atom/browser/lib/guest-view-manager.coffee @@ -134,6 +134,8 @@ attachGuest = (embedder, elementInstanceId, guestInstanceId, params) -> guestInstanceId: guestInstanceId nodeIntegration: params.nodeintegration ? false plugins: params.plugins + allowDisplayingInsecureContent: params.allowDisplayingInsecureContent ? false + allowRunningInsecureContent: params.allowRunningInsecureContent ? false webSecurity: !params.disablewebsecurity webPreferences.preloadURL = params.preload if params.preload diff --git a/atom/renderer/lib/web-view/web-view-attributes.coffee b/atom/renderer/lib/web-view/web-view-attributes.coffee index 313dc6ddfb..48083cc641 100644 --- a/atom/renderer/lib/web-view/web-view-attributes.coffee +++ b/atom/renderer/lib/web-view/web-view-attributes.coffee @@ -226,6 +226,8 @@ WebViewImpl::setupWebViewAttributes = -> @attributes[webViewConstants.ATTRIBUTE_HTTPREFERRER] = new HttpReferrerAttribute(this) @attributes[webViewConstants.ATTRIBUTE_USERAGENT] = new UserAgentAttribute(this) @attributes[webViewConstants.ATTRIBUTE_NODEINTEGRATION] = new BooleanAttribute(webViewConstants.ATTRIBUTE_NODEINTEGRATION, this) + @attributes[webViewConstants.ATTRIBUTE_ALLOWDISPLAYINGINSECURECONTENT] = new BooleanAttribute(webViewConstants.ATTRIBUTE_ALLOWDISPLAYINGINSECURECONTENT, this) + @attributes[webViewConstants.ATTRIBUTE_ALLOWRUNNINGINSECURECONTENT] = new BooleanAttribute(webViewConstants.ATTRIBUTE_ALLOWRUNNINGINSECURECONTENT, this) @attributes[webViewConstants.ATTRIBUTE_PLUGINS] = new BooleanAttribute(webViewConstants.ATTRIBUTE_PLUGINS, this) @attributes[webViewConstants.ATTRIBUTE_DISABLEWEBSECURITY] = new BooleanAttribute(webViewConstants.ATTRIBUTE_DISABLEWEBSECURITY, this) @attributes[webViewConstants.ATTRIBUTE_ALLOWPOPUPS] = new BooleanAttribute(webViewConstants.ATTRIBUTE_ALLOWPOPUPS, this) diff --git a/atom/renderer/lib/web-view/web-view-constants.coffee b/atom/renderer/lib/web-view/web-view-constants.coffee index eeaab5354f..6401a4b158 100644 --- a/atom/renderer/lib/web-view/web-view-constants.coffee +++ b/atom/renderer/lib/web-view/web-view-constants.coffee @@ -11,6 +11,8 @@ module.exports = ATTRIBUTE_SRC: 'src' ATTRIBUTE_HTTPREFERRER: 'httpreferrer' ATTRIBUTE_NODEINTEGRATION: 'nodeintegration' + ATTRIBUTE_ALLOWDISPLAYINGINSECURECONTENT: 'allowDisplayingInsecureContent' + ATTRIBUTE_ALLOWRUNNINGINSECURECONTENT: 'allowRunningInsecureContent' ATTRIBUTE_PLUGINS: 'plugins' ATTRIBUTE_DISABLEWEBSECURITY: 'disablewebsecurity' ATTRIBUTE_ALLOWPOPUPS: 'allowpopups'