diff options
author | Viktor Engelmann <viktor.engelmann@qt.io> | 2017-07-03 15:51:51 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-09-18 18:06:55 +0000 |
commit | 49c0ce8403e5caeb864f66553f122c68a7c975fb (patch) | |
tree | a3b4c1f89754c316fe1fb5cce4392dd05f1db4e7 /src/webenginewidgets/doc | |
parent | 8365186b3fdc2f1eca7e015147688d23bfdf81e9 (diff) |
Add Setting to allow passing unknown URL schemes to QDesktopServices
A new enum UnknownUrlSchemePolicy was added to WebEngineSettings,
QWebEngineSettings and QQuickWebEngineSettings.
WebContentsDelegate now has a new attribute of that type, which can
be read and written through the public APIs
Q(Quick)WebEngineSettings::unknownUrlSchemeNavigationPolicy and
Q(Quick)WebEngineSettings::setUnknownUrlSchemeNavigationPolicy.
This way, one can control, whether URLs with unknown schemes are passed
to QDesktopServices. WebContentsAdapterClient::navigationRequested is
called on these requests, so this allows more fine-grained control
over the schemes and origins, that are allowed.
Task-number: QTBUG-58627
Change-Id: Ie81d9503456d63ea1ed5606483254acf437cd8f7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/webenginewidgets/doc')
-rw-r--r-- | src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc index e6a94281e..06ed10b30 100644 --- a/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc +++ b/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc @@ -168,7 +168,22 @@ \value HideScrollbars Hides scrollbars. Disabled by default. (Added in Qt 5.10) +*/ +/*! + \enum QWebEngineSettings::UnknownUrlSchemePolicy + \since Qt 5.10 + + This enum describes how navigation requests to URLs with unknown schemes are handled. + + \value DisallowUnknownUrlSchemes + Disallows all navigation requests to URLs with unknown schemes. + \value AllowUnknownUrlSchemesFromUserInteraction + Allows navigation requests to URLs with unknown schemes that are issued from + user-interaction (like a mouse-click), whereas other navigation requests (for example + from JavaScript) are suppressed. + \value AllowAllUnknownUrlSchemes + Allows all navigation requests to URLs with unknown schemes. */ /*! @@ -224,6 +239,26 @@ */ /*! + \fn QWebEngineSettings::UnknownUrlSchemePolicy QWebEngineSettings::unknownUrlSchemePolicy() const + Returns the currently selected policy for handling navigation requests to URLs with + unknown schemes. Default is \l{QWebEngineSettings::AllowUnknownUrlSchemesFromUserInteraction}. + \sa setUnknownUrlSchemePolicy resetUnknownUrlSchemePolicy +*/ + +/*! + \fn void QWebEngineSettings::setUnknownUrlSchemePolicy(QWebEngineSettings::UnknownUrlSchemePolicy policy) + Sets the policy for handling navigation requests to URLs with unknown schemes to \a policy. + Default is \l{QWebEngineSettings::AllowUnknownUrlSchemesFromUserInteraction}. + \sa unknownUrlSchemePolicy resetUnknownUrlSchemePolicy +*/ + +/*! + \fn void QWebEngineSettings::resetUnknownUrlSchemePolicy() + Removes the policy for handling navigation requests to URLs with unknown schemes. + \sa unknownUrlSchemePolicy setUnknownUrlSchemePolicy +*/ + +/*! \fn void QWebEngineSettings::setAttribute(WebAttribute attribute, bool on) Enables or disables the specified \a attribute feature depending on the |