diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-09-13 11:57:31 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2016-09-22 15:29:27 +0000 |
commit | a7a7eb4c525a4fb78a3f0f1205262b147304261d (patch) | |
tree | f1e89a5ab3574777766c6151e3a28680aa57b202 /src/webengine/api/qquickwebenginesettings.cpp | |
parent | b04131f375a64204be962e7b92c88a3ecaf892c5 (diff) |
Expose allow-running-insecure-contents as a setting
AllowRunningInsecureContent was added as a setting in core to enable
parsing a chromium command-line argument. This patch forwards the
setting to our API layers.
[ChangeLog][Settings] Added setting to allow secure content to run
insecure content.
Task-number: QTBUG-54902
Change-Id: I4e005be1a29905ccf931fabe9ccb308b7d947c62
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'src/webengine/api/qquickwebenginesettings.cpp')
-rw-r--r-- | src/webengine/api/qquickwebenginesettings.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/webengine/api/qquickwebenginesettings.cpp b/src/webengine/api/qquickwebenginesettings.cpp index 7aa4d2a96..ba6563e47 100644 --- a/src/webengine/api/qquickwebenginesettings.cpp +++ b/src/webengine/api/qquickwebenginesettings.cpp @@ -331,6 +331,21 @@ bool QQuickWebEngineSettings::printElementBackgrounds() const } /*! + \qmlproperty bool WebEngineSettings::allowRunningInsecureContent + \since QtWebEngine 1.4 + + By default, HTTPS pages cannot run JavaScript, CSS, plugins or + web-sockets from HTTP URLs. This used to be possible and this + provides an override to get the old behavior. + + Disabled by default. +*/ +bool QQuickWebEngineSettings::allowRunningInsecureContent() const +{ + return d_ptr->testAttribute(WebEngineSettings::AllowRunningInsecureContent); +} + +/*! \qmlproperty QString WebEngineSettings::defaultTextEncoding \since QtWebEngine 1.2 @@ -515,6 +530,15 @@ void QQuickWebEngineSettings::setFocusOnNavigationEnabled(bool on) Q_EMIT focusOnNavigationEnabledChanged(); } + +void QQuickWebEngineSettings::setAllowRunningInsecureContent(bool on) +{ + bool wasOn = d_ptr->testAttribute(WebEngineSettings::AllowRunningInsecureContent); + d_ptr->setAttribute(WebEngineSettings::AllowRunningInsecureContent, on); + if (wasOn != on) + Q_EMIT allowRunningInsecureContentChanged(); +} + void QQuickWebEngineSettings::setParentSettings(QQuickWebEngineSettings *parentSettings) { d_ptr->setParentSettings(parentSettings->d_ptr.data()); |