summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/core/api/qwebenginecookiestore.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/core/api/qwebenginecookiestore.cpp b/src/core/api/qwebenginecookiestore.cpp
index 713dcdf6d..583ca1df8 100644
--- a/src/core/api/qwebenginecookiestore.cpp
+++ b/src/core/api/qwebenginecookiestore.cpp
@@ -336,9 +336,20 @@ void QWebEngineCookieStore::deleteAllCookies()
\since 5.11
Installs a cookie filter that can prevent sites and resources from using cookies.
- The \a filterCallback must be a lambda or functor taking a FilterRequest structure. If the
+ The \a filter must be a lambda or functor taking a FilterRequest structure. If the
cookie is to be rejected, the filter can set FilterRequest::accepted to \c false.
+ The following code snippet illustrates how to set a cookie filter:
+
+ \code
+ profile->setCookieFilter(
+ [&allowThirdPartyCookiesSetting](QWebEngineCookieStore::FilterRequest &request)
+ { request.accepted = !request.thirdParty || allowThirdPartyCookiesSetting; }
+ );
+ \endcode
+
+ You can unset the filter with a nullptr argument.
+
The callback should not be used to execute heavy tasks since it is running on the
IO thread and therefore blocks the Chromium networking.