diff options
author | Kirill Burtsev <kirill.burtsev@qt.io> | 2020-05-12 20:18:47 +0200 |
---|---|---|
committer | Kirill Burtsev <kirill.burtsev@qt.io> | 2020-05-14 17:16:35 +0000 |
commit | 9202da6fac5c9f818ba8c70f3902cc03f6bc1d16 (patch) | |
tree | 188ee5da93681ae41c25189cbfd768e5673de055 /src/core/web_contents_adapter.cpp | |
parent | 4242f2e65493349af091c0f588182493090dbed2 (diff) |
Allow to set feature permission before first ever navigation
Since PermissionManagerQt functions independent of webcontents initialization,
permission installment may be done earlier (right after page base constructor).
Practically, this allows to grant/deny permission before first ever navigation
to avoid permission feature request from well-behaving web application.
Unfortunately, this only applies to Web Notifications: there is a way
to check without request: Notification.permission javascript static object.
Other supported features lack similar mechanism: they operate through
success/failure callbacks, which unconditionally invoke permission requests,
and Page/View API doesn't automatically answer with remembered permissions.
Task-number: QTBUG-83476
Change-Id: I63a3cbca25498d5026975073e125f2ab4f9ab2ad
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/web_contents_adapter.cpp')
-rw-r--r-- | src/core/web_contents_adapter.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index 0f2f21f83..da2902dc3 100644 --- a/src/core/web_contents_adapter.cpp +++ b/src/core/web_contents_adapter.cpp @@ -1368,7 +1368,7 @@ void WebContentsAdapter::grantMediaAccessPermission(const QUrl &securityOrigin, void WebContentsAdapter::runFeatureRequestCallback(const QUrl &securityOrigin, ProfileAdapter::PermissionType feature, bool allowed) { - CHECK_INITIALIZED(); + Q_ASSERT(m_profileAdapter); m_profileAdapter->permissionRequestReply(securityOrigin, feature, allowed); } |