summaryrefslogtreecommitdiffstats
path: root/src/webenginequick/api/qquickwebengineprofile.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Associate permissions with framesKaloyan Chehlarski3 days1-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously, permisions were associated with the originating WebContents, as the PermissionManager API uses those in its function calls. This is insufficient, however, as it results in iframes not receiving the correct permissions (because they were instead granted to the root frame instead. This change modifies the internals of PermissionManagerQt to use GlobalRenderFrameHostTokens, and modifies relevant functions across the codebase to pass those around instead of WebContents. Media and mouse lock permissions now also query the permission manager before issuing a request, which avoids some cases of the same request being sent multiple times in a row. As a side effect, the behavior of non-persistent permissions (as well as the behavior of ALL permissions when running in AskEveryTime mode) is standardized so that a permission is remembered as long as the associated frame is alive. Fixes: QTBUG-134637 Fixes: QTBUG-135787 Pick-to: 6.10 6.9 Change-Id: I650e3328ef3830d06206acafc3305566d3a10d86 Reviewed-by: Allan Sandfeld Jensen <[email protected]>
* Add PersistentCookiesPolicy::OnlyPersistentCookiesMoss Heim13 days1-0/+6
| | | | | | | | | | | This new policy prevents session cookies from being saved to disk even for crash recovery purposes. Persistent cookies are still stored. As a drive-by add a missing data row in a QWebEngineProfileBuilder test Task-number: QTBUG-135799 Change-Id: I55364aa96c07ce83d3f30d812450421354310d72 Reviewed-by: Michal Klocek <[email protected]>
* Normalize signal/slot signatures 2025Marc Mutz2025-06-041-1/+1
| | | | | | | | | | | This is the result of running util/normalize on the code base. The following manual edits were needed: (none) Pick-to: 6.10 6.9 6.8 6.5 Change-Id: Ia59174aaf154559f7445e13d059723a282f75aae Reviewed-by: Allan Sandfeld Jensen <[email protected]>
* Add API for extension managementMartin Negyokru2025-05-291-0/+14
| | | | | | | | | | | | | | | Introduce QWebEngineExtensionManager and QWebEngineExtensionInfo. The manager has methods to load and install Chrome extensions from the filesystem. QWebEngineExtensionInfo provides information about a loaded extension. The current state of our js extension API support is very limited meaning most of the extensions downloaded from Chrome extension store won't work. Adding support for these APIs will be done in followup patches. Fixes: QTBUG-118452 Task-number: QTBUG-61676 Change-Id: I017ad5e8d2ba963afbd2f31ac36fee9451a951bd Reviewed-by: Allan Sandfeld Jensen <[email protected]>
* Fix QWebEngineDownloadRequest::pause()Szabolcs David2025-02-241-1/+1
| | | | | | | | | | | | | | Calling pause() (or any method which causes state update) in a directly connected signal handler of a download request causes an assertion fail in DownloadItemImpl::UpdateObservers() because it is protected from nested updates. Use QTimer::singleShot() to detach download requests and updates from the direct code path. Add auto test to check if pausing and resuming a download work. Pick-to: 6.8 6.9 Change-Id: Ia8c977a626fd0d39ca51df42984381a75cca2101 Reviewed-by: Allan Sandfeld Jensen <[email protected]>
* Add WebEngineProfilePrototype for profile creation from qmlAnu Aliyas2024-12-061-0/+7
| | | | | | | This is a wrapper designed to handle profile construction from qml. Change-Id: I6f3c9e06052c08e81422e148c75c599cc361be95 Reviewed-by: Michal Klocek <[email protected]>
* Lazy initialization for offTheRecord settingAnu Aliyas2024-11-201-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | As per the current design when switching from profile from OTR to non-OTR requires valid storage name. If it is not there, then QtWebEngine display a warning message and and don't switch to disk based behavior for qml. This impose the restriction on qml initialization order, for non-OTR profile, the initialization should be of the order given below WebEngineProfile { offTheRecord: false storgaeName: 'Test' } Otherwise it won't switch to non-OTR profile. For example a setting like WebEngineProfile { StorageName: 'Test' offTheRecord: false } won’t create a non-OTR profile. Though from an end user perspective these two initialization are identical, the order of initialization is different and due to which these two settings yield different profiles. Added a single shot signal handler on the offTheRecord setter to handle such cases, and it will switch the profile to non-OTR mode only when the storage name is set. Amends 5f42c1b7877b0c74d939af0f04d09a23482bc74a Fixes: QTBUG-131397 Pick-to: 6.8 Change-Id: I1c1c21808cb49dfa3ba4340b000242a0f54e59e5 Reviewed-by: Michael Brüning <[email protected]> Reviewed-by: Allan Sandfeld Jensen <[email protected]> (cherry picked from commit 3477d952575a8ad8a8ca70c04a7cd3aa5d7d5f81) Reviewed-by: Qt Cherry-pick Bot <[email protected]>
* Make download API asynchronousSzabolcs David2024-10-241-11/+10
| | | | | | | | | | | | | | | | | | | | | | | | Modify the already existing downloadRequest() API. Now the requests not necessarily have to be answered in a directly connected signal handler and the API users can postpone their user's decision. The only exceptions are automatically accepted save page requests. There is no better place to call their callback than directly after the signal emission. Adapt auto tests to the new lifecycle of download items. Modify the quicknanobrowser example to use a simple async method to wait for the user's decision. Keep simplebrowser to use its old synchronous method to illustrate that it's still possible. Correct documentation at some places. [ChangeLog] QWebEngineProfile::downloadRequested() is not limited to synchronous usage anymore. QWebEngineDownloadRequest can be accepted or rejected later without blocking the browsing session. Fixes: QTBUG-118584 Change-Id: Ic1be6508126574dc77aa686f85bf35feafdb080d Reviewed-by: Peter Varga <[email protected]>
* Make QQuickWebEngineDownloadRequest publicAllan Sandfeld Jensen2024-08-231-1/+1
| | | | | | | | | | We only really need the QWebEngineDownloadRequest, but the fact it was just that was in the private header. Pick-to: 6.8 Fixes: QTBUG-120370 Change-Id: I9bcd79e068e67ec0ed07ae31cfb2a0d4e011e22b Reviewed-by: Anu Aliyas <[email protected]>
* Doc: Replace \instantiates with \nativetypePaul Wicking2024-08-201-1/+1
| | | | | | | | | | | Since the implementation of the `\nativetype`-command in QDoc, the `\instantiates`-command is deprecated. Replace the use of the deprecated command in favor of its replacement. Pick-to: 6.8 Task-number: QTBUG-128216 Change-Id: I10cad9942e34301ded99c7014c1c70375e0698e1 Reviewed-by: Venugopal Shivashankar <[email protected]>
* Prevent OTR to non-OTR profile switching when the storage name is emptyAnu Aliyas2024-08-131-0/+7
| | | | | | | | | | | When switching from profile from OTR to non-OTR requires valid storage name. If it not there, then display a warning message and and don't switch to disk based behavior. Fixes: QTBUG-126312 Pick-to: 6.7 6.8 6.2 Change-Id: Id689c8b280b4070b9ecbf11c6001685ac4ffd2f3 Reviewed-by: Allan Sandfeld Jensen <[email protected]>
* Doc: Fix linking warnings for Qt WebEngineTopi Reinio2024-07-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes the following warnings: src/core/doc/src/qwebenginepage_lgpl.qdoc:464: (qdoc) warning: Can't link to 'QWebEnginePage::action(WebAction action)' src/core/api/qwebenginewebauthuxrequest.cpp:109: (qdoc) warning: Can't link to 'WebEngineWebAuthUxRequest.PinEntryReason.Challenge' src/core/api/qwebenginewebauthuxrequest.cpp:113: (qdoc) warning: Can't link to 'WebEngineWebAuthUxRequest.WebAuthUxState.CollectPin' src/core/api/qwebenginewebauthuxrequest.cpp:141: (qdoc) warning: Can't link to 'WebEngineWebAuthUxRequest.PinEntryReason.Challenge' src/webenginequick/api/qquickwebengineprofile.cpp:498: (qdoc) warning: Can't link to 'storageName()' src/webenginequick/api/qquickwebenginescriptcollection.cpp:119: (qdoc) warning: Undocumented return value src/webenginequick/doc/src/webengineview_lgpl.qdoc:879: (qdoc) warning: Can't link to 'WebEngineSettings::JavascriptCanPaste' src/webenginequick/doc/src/webengineview_lgpl.qdoc:880: (qdoc) warning: Can't link to 'WebEngineSettings::JavascriptCanAccessClipboard' In addition, drop remaining references to 'Pepper Plugin API' as that documentation was removed in 9d5f94b7f4b954bbe7e261d184420e237c704557. Pick-to: 6.8 Change-Id: I41fcddcc909b703705f2c32c2c3860872da60a72 Reviewed-by: Paul Wicking <[email protected]>
* Add a new constructor to QQuickWebEngineProfileSzabolcs David2024-07-081-0/+18
| | | | | | | | | Providing a storageName at construction time allows users to create profiles in C++ which are not off-the-record by default. Task-number: QTBUG-126085 Change-Id: I9986a1242309e45fcf13d1b8362508238ca00350 Reviewed-by: Michael Brüning <[email protected]>
* QWebEnginePermission: Post-API reviewKaloyan Chehlarski2024-07-031-46/+51
| | | | | | | | | | | | | | | This commit contains fixes for the issues found during the API review of the new permissions API. In particular: - All new enums are now scoped - Replaced isTransient with its opposite, isPersistent - Renamed Feature to PermissionType - Made origin() return a non-const QUrl - Renamed PersistentPermissionsPolicy members to be more concise - Fixed a couple of bugs in the implementation - Updated documentation Change-Id: Idf84e1c9ba3ae803ef4686e1caa7f3e6c198c87d Reviewed-by: Michal Klocek <[email protected]>
* Clarify the OTR nature of default QQuickWebEngineProfilesSzabolcs David2024-06-181-2/+17
| | | | | | | | | | Since the default profile is OTR now, this behavior needs more mention in the documentation. Pick-to: 6.8 Task-number: QTBUG-126085 Change-Id: I26b5f05cc8c76982bc97deaecd0df835c8ad82fb Reviewed-by: Peter Varga <[email protected]>
* Implement API for listing existing permissions in a profileKaloyan Chehlarski2024-06-031-0/+142
| | | | | | | | | | | QWebEngineProfile and QQuickWebEngineProfile now have methods for either getting one specific permission object, or for getting a list of all the permissions currently stored. The methods for listing also have overloads for filtering based on origin or Feature type. Pick-to: 6.8 Change-Id: I07241bcb3ff171fa8b82547c2b5f094071bebe44 Reviewed-by: Allan Sandfeld Jensen <[email protected]>
* Implement optional website permission persistenceKaloyan Chehlarski2024-06-011-5/+78
| | | | | | | | | | | | | | | | | | | | | | | | | This change introduces a new API allowing application developers to choose whether they want to retain the granted/denied status of permissions between different pages or browsing sessions. The previous behavior of asking for permission every time is still optionally available, but the default behavior is to persist permissions inbetween sessions (except for off-the-record profiles, where the permissions get destroyed alongside the profile). Storage is handled via a PrefService, which writes to a permissions.json file stored inside the profile folder. This is different to Chromium's implementation, which is massively overengineered and would require enabling a ton of code we will never need to use. [ChangeLog][QtWebEngineCore][QWebEngineProfile] Added new API to control permission persistence. [ChangeLog][QtWebEngineQuick] Added new API to control permission persistence. Fixes: QTBUG-55108 Change-Id: Ib3057feda3bfbbf2a17a86356feca35a67180806 Reviewed-by: Allan Sandfeld Jensen <[email protected]>
* Document how to use signal with private typesAllan Sandfeld Jensen2024-04-301-0/+4
| | | | | | | | | Needed until we make it public in 6.8 Pick-to: 6.7 6.6 Task-number: QTBUG-120370 Change-Id: I6a6aea92d2cc27142fbbc6cb021787daefa68ad0 Reviewed-by: Allan Sandfeld Jensen <[email protected]>
* Document QWebEngineClientHintsSzabolcs David2024-01-111-0/+6
| | | | | Change-Id: If975c71e0738358a7fd18d0c34974e6463759421 Reviewed-by: Allan Sandfeld Jensen <[email protected]>
* Add API to override User Agent Client HintsSzabolcs David2023-12-141-0/+8
| | | | | | | | | | | Implement QWebEngineClientHints class to provide API for each user agent client hints. Task-number: QTBUG-112826 Task-number: QTBUG-112825 Change-Id: I3091d60fb363bbafc16c8e48195c1fd82e8a81bb Reviewed-by: Allan Sandfeld Jensen <[email protected]> Reviewed-by: Qt CI Bot <[email protected]>
* Remove WebEngineDownloadItem type from docsSzabolcs David2023-10-161-3/+3
| | | | | | | | It was renamed to WebEngineDownloadRequest. Pick-to: 6.6 Change-Id: Ibb00a0d10459110ceb7264631de5981f256f6c65 Reviewed-by: Allan Sandfeld Jensen <[email protected]>
* Remove QWebEngineUrlResponseInterceptor APIMichael Brüning2023-08-241-13/+0
| | | | | | | | | | | | | | | | | It has been found to not have any real effect, therefore, we remove it again to not release a non-functional API and create false expectations in users. This reverts commits 3f5de5fab74e6c152cdf5d04f3d893feaa31790b ab21f39c6a54be331dd8a155d3374bfe790e0274 (parts) 082eef1916a86d6d5e0c751d271c7c8a1a5e457d 5e257fb57a211f95556ec387fe6f262a60cbb6fe Pick-to: 6.6 Task-number: QTBUG-61071 Change-Id: Ifb33e32128e77dfffed863a1a7501ba21796692d Reviewed-by: Allan Sandfeld Jensen <[email protected]>
* Add clearHttpCacheCompleted signal to profilePeter Varga2023-08-171-2/+34
| | | | | | | | | | | | | [ChangeLog][QtWebEngineQuick][WebEngineProfile] Added clearHttpCacheCompleted signal. [ChangeLog][QtWebEngineCore][QWebEngineProfile] Added clearHttpCacheCompleted signal. Fixes: QTBUG-89670 Fixes: QTBUG-111541 Change-Id: If93a99f7171c516ef75a3c8004da9ae621705a1a Reviewed-by: Leena Miettinen <[email protected]> Reviewed-by: Michal Klocek <[email protected]>
* Add WebEngineView::save() convenience APIAnu Aliyas2023-04-201-1/+2
| | | | | | | | | | Add the convenience method QQuickWebEngineView::save for saving pages without the need to explicitly handle download requests. Task-number: QTBUG-56093 Change-Id: I67909fdca6472d1ea9b32e0f89c1ab90219bca3b Reviewed-by: Leena Miettinen <[email protected]> Reviewed-by: Michal Klocek <[email protected]>
* QWebEngineUrlResponseInterceptor: Implement new URL response interceptorYigit Akcay2023-03-101-0/+13
| | | | | | | | | | | | | | | | | | | | | This patch adds the QWebEngineUrlResponseInterceptor abstract class, which, when implemented, allows a user to intercept response headers and modify them in any way they like. A response interceptor can be set via QWebEngineProfile::setUrlResponseInterceptor(), QQuickWebEngineProfile::setUrlResponseInterceptor() or QWebEnginePage::setUrlResponseInterceptor(). Also, the QWebEngineUrlResponseInfo class is implemented, which contains the request and response data to be used with the response interceptor. If a response interceptor is set in the profile and page, the one in the profile takes precedence. Fixes: QTBUG-61071 Change-Id: I484d14373ff597b1d531541c066f0102bae28c72 Reviewed-by: Michael Brüning <[email protected]>
* Fix initialization of QWebEngineDownloadRequest::totalBytes for WidgetsPeter Varga2023-03-011-1/+3
| | | | | | | | | | | | QQuickWebEngineProfile already initializes totalBytes. Also clean up QWebEngineDownloadRequestPrivate and fix typo in documentation. Pick-to: 5.15 6.4 6.5 Fixes: QTBUG-104869 Change-Id: I8c4b79c076ddc63180960e22a9488b45ff6c4402 Reviewed-by: Allan Sandfeld Jensen <[email protected]>
* Remove setPushServiceEndpoint from APIMichal Klocek2022-12-221-24/+16
| | | | | | | | | | Use setPushServiceEnabled instead. Update also getter and documentation. Task-number: QTBUG-107442 Pick-to: 6.5 Change-Id: I299ce88b06edef0f1a0088fb10f4a142056039be Reviewed-by: Michael Brüning <[email protected]>
* Enable Push MessagingSzabolcs David2022-09-121-0/+43
| | | | | | | | | | | | | | | | | | Use Chrome's implementation of PushMessagingService. This feature relies on notification permissions, so it is not different from Web Notification from end-users perspective. We don't persist push subscriptions, because it seems these have to be consistent with persisting notification permissions. Make address of push service configurable by a profile setting. It is empty by default - which means the feature is disabled until the user sets the address of a push service. Task-number: QTBUG-98904 Task-number: QTBUG-53457 Change-Id: If44f459fecf2da482c28fee5562f62fe40de103e Reviewed-by: Allan Sandfeld Jensen <[email protected]>
* Use SPDX license identifiersLucie Gérard2022-06-221-38/+2
| | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: I869ffda1080e283f231eb0dc4477b260f2054d99 Reviewed-by: Jörg Bornemann <[email protected]>
* Protect against default profile being deleted before its pagesAllan Sandfeld Jensen2022-06-131-0/+2
| | | | | | | | | Can really only happen in QML on exit. Pick-to: 6.3 6.4 Task-number: QTBUG-99445 Change-Id: I1a04d57b6c4c40ae264b5519d2e41c57bca79a61 Reviewed-by: Michal Klocek <[email protected]>
* Adaptations for Chrome 98Allan Sandfeld Jensen2022-03-291-0/+5
| | | | | Change-Id: I607604f85a111a69da77ca949dddf3399b9721b3 Reviewed-by: Peter Varga <[email protected]>
* Add userScript docs for qml landMichal Klocek2022-03-101-1/+1
| | | | | | | | | | | | | | WebEngineScript docs were missing after moving classes to core. Moreover we changed WebEngineScript to be a qml value type and we introduced WebEngineScriptCollection to mirror C++ class. Add the documentation for WebEngineScript, WebEngineScriptCollection and WebEngine.script() method. Task-number: QTBUG-100404 Pick-to: 6.2 6.3 Change-Id: Ifed1bd1fa398a8634df0dc1bd44111e1a09ded04 Reviewed-by: Kirill Burtsev <[email protected]>
* Add QML test for basic profiles and fix the docs accordinglyKirill Burtsev2022-02-171-10/+11
| | | | | | | | | Amends d0ff107c00. Ensure default values for profile settings match the docs. Also fix doc's issues after off-the-record toggle to off by default. Pick-to: 6.2 6.3 Change-Id: I558a77dbec82d7f2b335b1a2ceca74ab66a1a6e9 Reviewed-by: Michal Klocek <[email protected]>
* Fix crash on WebEngine(View|Profile).userScripts.collection getKirill Burtsev2022-02-101-4/+26
| | | | | | | | | | | | | | | To create a javascript list on 'collection' method qml engine is needed for a qml scope, but it's only available for objects, which are created by the QML Engine itself. The only object in hierarchy of classes is an actual WebEngineView, so get it from there on collection init. Also implement delayed initialization of scripts collection for the usage of default profile through WebEngine singleton, and for the reason that it's not really needed until really asked by user code. Pick-to: 6.2 6.3 Fixes: QTBUG-96597 Change-Id: I61e76652a5d0fd5609070fd541816503908f2dc8 Reviewed-by: Allan Sandfeld Jensen <[email protected]>
* Hide unneeded Quick C++ APIsKirill Burtsev2021-08-171-1/+1
| | | | | | | | They are not supposed to be a part of public Quick API Pick-to: 6.2 Change-Id: Ib04ea022192d0eec559c28a48bc87fabda932564 Reviewed-by: Allan Sandfeld Jensen <[email protected]>
* Clean up quick APIPeter Varga2021-07-191-4/+4
| | | | | | Pick-to: 6.2 Change-Id: I9407d407b203b8e2bb13768e5a899624ea47282a Reviewed-by: Michal Klocek <[email protected]>
* Remove deprecated useforglobalcertificateverificationPeter Varga2021-07-061-69/+0
| | | | | | | | | | | | It enabled an unrecommended OCSP path on Linux [ChangeLog] (Q)WebEngineSettings::useForGlobalCertificateVerification has been removed. Pick-to: 6.2 Task-number: QTBUG-91467 Change-Id: I9f5d1ad5e4fcb59abd31e6a133ded7bf8319c811 Reviewed-by: Kirill Burtsev <[email protected]>
* Doc: Fix documentation issues for Qt WebEngineTopi Reinio2021-07-011-4/+2
| | | | | | | | | | API and documentation changes since 5.15 caused multiple warnings from QDoc; this change addresses most of them. Some warnings indicate missing documentation, those issues still remain. Pick-to: 6.2 Change-Id: I96be38b7daac37a7e35c149b4b3ec3f18c4415c9 Reviewed-by: Topi Reiniö <[email protected]>
* Fix C++ documentation references to QtWebEngineQuickAllan Sandfeld Jensen2021-06-231-1/+1
| | | | | | Pick-to: 6.2 Change-Id: Ic43fb3fb8c5e12fd14b19979749a2f1d5015644a Reviewed-by: Michal Klocek <[email protected]>
* Add page() and view() back to download-itemAllan Sandfeld Jensen2021-06-211-6/+8
| | | | | | | | Restores a QML type but this time derived from the core type. Pick-to: 6.2 Change-Id: I09ddb6672f7262ae31e4c57f09d019f71abccd41 Reviewed-by: Kirill Burtsev <[email protected]>
* Fix some compiler warningsPeter Varga2021-06-101-2/+2
| | | | | | | | | | | | | - Remove deprecated Qt::AA_EnableHighDpiScaling and Qt::AA_UseHighDpiPixmaps from examples. High-DPI scaling is always enabled. - Reorder initialization of members of QWebEngineDownloadRequestPrivate. Also remove m_ prefix from public members' name. - Remove unused parameters from methods of DummyDelegate. - Add missing overrides in auto tests. Pick-to: 6.2 Change-Id: I18d6973b8bee574b37b73fbaaa8d57002ac8ba2d Reviewed-by: Allan Sandfeld Jensen <[email protected]>
* Add WebEngineWidgets, WebEngineQuick modules cmake buildMichal Klocek2021-05-191-10/+8
| | | | | | | | | Fix some library dependencies and make proper header includes in core. Task-number: QTBUG-91760 Change-Id: I415361dd42ef2cc39716ce3f5f56e6e8556ac4c8 Reviewed-by: Allan Sandfeld Jensen <[email protected]>
* Fix 'WebEngine' ambiguity for Qt6Michal Klocek2021-04-131-0/+1042
'WebEngine' is a qml module, however name itself is ambiguous. Thefore now with Qt6 and with cmake port name the module as WebEngineQuick. Change-Id: I948672dd5d389a01c6a31ec871459164fd989c0f Reviewed-by: Allan Sandfeld Jensen <[email protected]>