summaryrefslogtreecommitdiffstats
path: root/src/webenginequick/api
Commit message (Collapse)AuthorAgeFilesLines
* Implement API for listing existing permissions in a profileKaloyan Chehlarski9 days2-0/+148
| | | | | | | | | | | 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 <allan.jensen@qt.io>
* Add QWebEnginePermission and rewrite permissions APIKaloyan Chehlarski9 days5-54/+170
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the addition of permission persistence, it's now important for us to have an API for querying previously granted/denied permissions, so that they can be revoked at a later point. This change does the bulk of the work to get us there, by introducing a new type representing a single permission for a given URL/Feature pair. This type holds no information about the permission's state; it is simply an accessor object which allows its user to query the current status of the permission, grant/deny it, or reset it back to its initial state (so, delete it from storage). This provides application developers an easy way to store/modify lists of permissions without having to define their own custom types. A subsequent change will expand the API to provide a list of all permissions for a given profile. The current API (in QWebEnginePage and QQuickWebEngineView) has been marked as deprecated, but has not been disabled to ensure a smooth transition for developers. [ChangeLog][QtWebEngineCore][QWebEnginePage] Deprecated old permissions API [ChangeLog][QtWebEngineQuick][WebEngineView] Deprecated old permissions API [ChangeLog][QtWebEngineCore] Added new API for querying and modifying website permissions. [ChangeLog][QtWebEngineQuick] Added new API for querying and modifying website permissions. Pick-to: 6.8 Change-Id: I8661cdc26bbd6dcde6403d29cc083bcea1a49ccc Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add QWebEngineFrame::printToPdfMoss Heim9 days2-9/+11
| | | | | | | | | Provide API calls to (1) save to file (QString) and (2) get the bytes in a callback. Pick-to: 6.8 Change-Id: I0ff44a25328b99080491b8c3b36a7b632c065131 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Implement optional website permission persistenceKaloyan Chehlarski11 days2-5/+90
| | | | | | | | | | | | | | | | | | | | | | | | | 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 <allan.jensen@qt.io>
* Merge printToPdf callback systemsMoss Heim12 days2-10/+21
| | | | | | | | Provide a common API in WebContentsAdapterClient so it can be used easily by QWebEngineFrame. Change-Id: I9abc1214cf535c3110d54d9ecb3257000c6db5fb Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add QWebEnginePage::printRequestedByFrame signalMoss Heim12 days3-0/+10
| | | | | | | | | Emitted whenever a frame excluding the main frame calls JS print() function. `printRequested` is now only emitted when the main frame requests printing, instead of any frame. Change-Id: I4b65e5a164b513cc9a9692c1285470847b7a26e3 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add documentation for WebEngineWebAuthPinRequest qmltypeAnu Aliyas12 days1-0/+9
| | | | | | | | Added missing documentation for WebEngineWebAuthPinRequest Fixes: QTBUG-123008 Change-Id: Iecf58499b1698688d5e8b8d64c8cb83f21cf0598 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add QWebEngineFrame::runJavaScriptMoss Heim2024-05-222-4/+4
| | | | | | | | | | | | | Run JavaScript code on a specific frame, optionally executing a callback when done. Uses the enclosing page's callback system. There are two sets of overloads, matching the API of QQuickWebEngineView and QWebEnginePage. Also adds QQuickWebEngineFrame::runJavaScript() Change-Id: I48746bd83d0f19644157548483a94637fc70c20f Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add zoomFactorChanged signal to QWebEnginePage and QQuickWebEngineViewKaloyan Chehlarski2024-05-172-1/+7
| | | | | | | | | | | | | | Added a signal that fires whenever the zoom factor for a given page changes, including both via key combinations, and when using the existing zoom API. This already existed in Quick, but was both undocumented and only half-implemented (zooming via keyboard/mouse wouldn't trigger it). Thus, the Quick documentation was changed to list it as a 6.8 addition. Fixes: QTBUG-111041 Change-Id: I91eb7c9bf0d17d99956784841c5c86640554ad1c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Merge runJavaScript functions in QWEPage, QQWEViewMoss Heim2024-05-152-19/+18
| | | | | | | | | | | These two are identical except for the use of QJSValue to wrap a JS callback. And we would like to have a function on WebContentsAdapterClient for QWEFrame to call. So we wrap the JS callback in a std::function<> callback and merge the APIs. Change-Id: Ifc55d3748b1b3764e802e4908c474b40cc92f9cc Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add QML support for QWebEngineFrameMoss Heim2024-05-072-0/+18
| | | | | | Change-Id: I1f5843b1abba9edb3c106718abac5cd92ee961cd Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Thread safe implementation of Favicon Quick APIAnu Aliyas2024-04-306-145/+184
| | | | | | | | | | Ensured thread-safe access to quick classes, by moving all interaction with these classes to UI thread. Removed thread pool and used signals and slots instead Pick-to: 6.7 6.6 Change-Id: Icd5cecf73258fd7da04f56cd5dd5cb83904b8b40 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* 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 <allan.jensen@qt.io>
* Add hasPostData to QWebEngineNavigationRequestAllan Sandfeld Jensen2024-04-262-3/+3
| | | | | | | | | | [ChangeLog][QtWebEngineCore][QWebEngineNavigationRequest] hasFormData has been added to indicate navigations request (re)posting form data. Fixes: QTBUG-67613 Change-Id: I0275513a12d4591a53040c62bfce636e99926ab7 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu> Reviewed-by: Anu Aliyas <anu.aliyas@qt.io>
* Add the missing _p suffix to the private header files in WebEngineQuick/WidgetsAlexey Edelev2024-04-252-4/+4
| | | | | | | Pick-to: 6.5 6.6 6.7 Change-Id: I4b64147cb70c3994ed054374c9047fe9274da777 Reviewed-by: Moss Heim <moss.heim@qt.io> Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Add local fonts permission support to QuickWebEngineViewKaloyan Chehlarski2024-03-222-0/+7
| | | | | | | | | This change hooks up QuickWebEngineView to the newly-enabled local font access API. Task-number: QTBUG-121320 Change-Id: Ib7e093904ea8d834a2282cd265086e501cb392ff Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add granular permission for clipboard-read/writeMoss Heim2024-03-112-0/+8
| | | | | | | | | | | | | | | Previously, permissions for clipboard access could only be managed through the JavascriptCanAccessClipboard and JavascriptCanPaste settings. This change allows copy/paste to be handled the same way as notification and geolocation permissions. If both JavascriptCanAccessClipboard and JavascriptCanPaste are enabled, permissions will be granted unconditionally without a feature request being made. Fixes: QTBUG-77450 Change-Id: I383e27e244ced3d6b7988644e38d2307c6267f76 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add setting method to set image animation policyAnu Aliyas2024-03-072-1/+50
| | | | | | | | - added a method to set image animation policy in QWebEngineSettings Fixes: QTBUG-86154 Change-Id: I8b3ab6067f9cff4219b0da90bb8601406cb98e24 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Correctly hook up spellchecker suggestions to QMLKaloyan Chehlarski2024-03-011-1/+4
| | | | | | | | | | | | | | | Currently, spelling suggestions that would normally appear in the context menu when right-clicking a misspelled word do not work in QML applications. Instead, the context menu gets filled with empty, nonfunctional labels. This change makes sure the QQuickWebEngineAction object has valid m_text and m_enabled fields, and that QQuickWebEngineView::triggerWebAction doesn't get tripped up by the fact that there's no WebAction corresponding to text replacement. Change-Id: I208950d815ae43e0a691245698e287adf099a7b3 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Recommend against JsCanPaste/CanAccessClipboardMoss Heim2024-02-261-0/+8
| | | | | | | | | Now that we have the ClipboardReadWrite feature, we can recommend against enabling these features globally and use the feature permission instead. Change-Id: Id8113383c3d5c50d2e7da3ace0e5c5eb38684d03 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fix QWebEngineDesktopMediaRequest after API review updateMartin Negyokru2024-02-241-0/+1
| | | | | | | | | | | - The request has to be copyable to make it compatible with qml - Bring back EditRole - Remove QWebEngineMediaSourceModelPrivate Pick-to: 6.7 Change-Id: I28f64947eec8f041dab6feefa3d3ba85154975c8 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Add scroll animator to QML APIAllan Sandfeld Jensen2024-02-012-0/+26
| | | | | | | | | | Was missing from the QML settings. Change-Id: I585fd7906b6831d9cf1c560427be18b1d76fd8ca Fixes: QTBUG-85473 Reviewed-by: Michael Brüning <michael.bruning@qt.io> Reviewed-by: Anu Aliyas <anu.aliyas@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Fix misleading warningAllan Sandfeld Jensen2024-01-311-3/+6
| | | | | | | | | | This is only relevant for OpenGL or backends that needs to be forced to OpenGL Pick-to: 6.7 6.6 Change-Id: Idd96e41c2ca2a87d1dd916e2fadf8945ee25805f Fixes: QTBUG-99446 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* Correct PrintedPageSizeId to match QPageSize::PageSizeIdMichael Brüning2024-01-242-7/+133
| | | | | | | | | | With Qt 6, QPageSize::PageSizeId enum was cleaned up and some values were reordered, but the WebEngineQuick part was not changed accordingly. Pick-to: 6.7 6.6 6.5 Fixes: QTBUG-120218 Change-Id: I7e4c419750d30a64193e68b0b217ebbccce07d87 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Update QWebEngineDesktopMediaRequest based on API reviewMartin Negyokru2024-01-221-0/+1
| | | | | | | | | | | | | - Port the request's d-pointer to std::unique_ptr - Disable copy of the request - Remove QWebEngineMediaSourceModel from the header - Remove the NameRole definition - Update tests and documentation according to changes - Use forward declaration in qwebenginepage Pick-to: 6.7 Change-Id: I972b3104a0bca5367a4bb63ac183a60d00a71776 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Update QWebEngineWebAuthUxRequest based on 6.7 API review commentAnu Aliyas2024-01-174-8/+8
| | | | | | | | | | | - Modified WebAuthUXState as enum class - Renamed QWebEngineWebAuthUXRequest as QWebEngineWebAuthUxRequest - Renamed QWebEngineWebAuthPINRequest as QWebEngineWebAuthPinRequest - Replaced all occurrence of UX and PIN with Ux and Pin respectively Fixes: 6.7 Change-Id: Iaf0b4c93e0dfa3508a604f7d6562c4401ff800af Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Remove the use of Q_WEBENGINEQUICK_PRIVATE_EXPORTAlexey Edelev2024-01-1613-23/+17
| | | | | | Task-number: QTBUG-117983 Change-Id: I6139881e02f5cc9e47cb7d7f78b4bf4675b09fb5 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Document QWebEngineClientHintsSzabolcs David2024-01-111-0/+6
| | | | | Change-Id: If975c71e0738358a7fd18d0c34974e6463759421 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add new API for screen capturingMartin Negyokru2023-12-153-0/+12
| | | | | | | | | | | | [ChangeLog][WebEngineCore] Add QWebEnginePage::desktopMediaRequested() signal [ChangeLog][WebEngineQuick] Add QQuickWebEngineView::desktopMediaRequested() signal Pick-to: 6.7 Fixes: QTBUG-112142 Task-number: QTBUG-70077 Change-Id: I4bfad88732b45fb68b77f7617440bcb50b248a11 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add API to override User Agent Client HintsSzabolcs David2023-12-143-0/+12
| | | | | | | | | | | 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 <allan.jensen@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Fix for tst_qmltests crashAnu Aliyas2023-11-091-0/+2
| | | | | | | | | - As per current the implementation, if the parent Qucikitems has foucs, calling setParentItem(nullptr) on it's children might lead to crash. Task-number: QTBUG-118750 Change-Id: I540e46658a21c14bb26f8f316fdd520f7b1a4742 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Correct WebEngineWebAuthUXRequest qml type informationAnu Aliyas2023-10-161-3/+5
| | | | | | | | | - Registered QWebEngineWebAuthUXRequest as a non-instantiable type. Task-number: QTBUG-90941 Task-number: QTBUG-90938 Change-Id: I702cb3b37399f24362ec6ff1eb7c19b1d5dd9437 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* 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 <allan.jensen@qt.io>
* Provide the correct type information for WebEngineViewAnu Aliyas2023-10-133-9/+28
| | | | | | | | | | | | -Duplicate entries in the QML type file are created when exporting the type as a value and its enums within a namespace. Resolved this by introducing a derived class, and using it for exporting the Enums. - Added namespace resolution to avoid type ambiguity Fixes: QTBUG-117031 Pick-to: 6.6 Change-Id: Ieea4492238843c3c781c8d9602ddc89207b61137 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Add QWebEngineSettings::ForceDarkModeMartin Negyokru2023-09-282-0/+25
| | | | | | | | | Enable forcibly modifying content rendering to result in dark color scheme. [ChangeLog][Settings] ForceDarkMode added, disabled by default. Fixes: QTBUG-84484 Change-Id: I4b3512dc365c61da8f91d8dead0715dadce91f75 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fix revisions of QML APIAllan Sandfeld Jensen2023-09-051-1/+1
| | | | | | | | See QML API review Pick-to: 6.6 Change-Id: I8eaba74655cb73bac912a48964d86e647c7a854f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Remove QWebEngineUrlResponseInterceptor APIMichael Brüning2023-08-242-15/+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 <allan.jensen@qt.io>
* QQuickWebEngineView: move using declarations outside of QT_DEPRECATED_SINCE ↵Ivan Solovev2023-08-211-3/+2
| | | | | | | | | | | block Because they are also used in the code which is not guarded by the deprecation checks. Pick-to: 6.6 6.5 Change-Id: I42383ba0f11b08df5602bfa9e0d8d816d2b96be7 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* QWebEngineQuotaRequest: add deprecation guardsIvan Solovev2023-08-211-0/+2
| | | | | | | | | | This class was marked as deprecated for Qt 6.5, but not everywhere. This commit amends 8fd7140082e3a752ca80882a29128ffc12d12fa4. Pick-to: 6.6 6.5 Change-Id: I7253a88aae20519befbabf01e63bb7d49c37cef0 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Add clearHttpCacheCompleted signal to profilePeter Varga2023-08-173-2/+36
| | | | | | | | | | | | | [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 <riitta-leena.miettinen@qt.io> Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Prevent QWebEngineCertificateError from being exported twice to QMLIvan Solovev2023-08-111-1/+8
| | | | | | | | | | | | | | We need to export the type as a value type, and also export its enums in a namespace. This resulted in duplicated entries in the qmltypes file, which confuses Qt Design Studio. Fix it by introducing a derived class, and using it for exporting the enums. Fixes: QTBUG-115365 Pick-to: 6.6 6.5 Change-Id: I5900f4f76fb6357c9262496cc3cc01b276387e46 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Rename disableReadingFromCanvas to follow naming styleAllan Sandfeld Jensen2023-08-102-14/+16
| | | | | | | | | | | We prefer to name settings with Enabled at the end. From API review. Pick-to: 6.6 Change-Id: I7aacc6dbb92d852fd21b067475d2fd9e7df56163 Reviewed-by: Michal Klocek <michal.klocek@qt.io> Reviewed-by: Anu Aliyas <anu.aliyas@qt.io>
* Make webengineview::save a slotAllan Sandfeld Jensen2023-08-101-4/+3
| | | | | | | | From API review Pick-to: 6.6 Change-Id: I7071b05bd92eaefd922913e2800e4b9ade71ec1f Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Do comments from api 6.6 reviewMichal Klocek2023-07-261-1/+1
| | | | | | | | | | Additionally make destructor out of line in qwebengineurlrequestinterceptor as it mirrors qwebenigneurlresponeinterceptor. Pick-to: 6.6 Change-Id: I0cdf7eae9faa671415359368560fb8f6aabf05fe Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Support FIDO2 user verificationAnu Aliyas2023-07-124-0/+18
| | | | | | | | | | | - Implemented AuthenticatorRequestClientDelegateQt support to handle authenticator requests. - Added FIDO user verification and resident credential support Fixes: QTBUG-90938 Fixes: QTBUG-90941 Change-Id: I6367791e1e9e8aaac27c376408377f838832f426 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Reduce repetitive translated texts of QQuickWebEngineView/QWebEnginePage actionsFriedemann Kleint2023-06-301-61/+2
| | | | | | | | | | With the action enums in sync, a helper for function returning the translated texts for the enum values can be introduced. Pick-to: 6.6 Change-Id: I1584f0a4d3fd55d0308dbb914777346ba9d0e285 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Sync WebAction enums of QQuickWebEngineView/QWebEnginePageFriedemann Kleint2023-06-282-0/+5
| | | | | | | Pick-to: 6.6 Change-Id: Ibe750d541dba458f2278632355bcaf864fdc845a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Add QWebEnginePage::devToolsId()Benjamin Terrier2023-05-312-0/+8
| | | | | | | | [ChangeLog][WebEngineCore] Add QWebEnginePage::devToolsId() [ChangeLog][WebEngineView] Add devToolsId property Change-Id: I16e8a27d595b010239557c2a3af2d3b39976cd46 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Test for presence of local frame in runJavaScriptAllan Sandfeld Jensen2023-05-161-1/+5
| | | | | | | | | It can be missing if we are in the process of shutting down. Pick-to: 6.5 6.2 Fixes: QTBUG-113400 Change-Id: Ib494e479db08d51825c15f54354037c265ba96b0 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Add QWebEngineSettings::DisableReadingFromCanvasAnu Aliyas2023-04-242-0/+26
| | | | | | | | - disables reading from canvas. Fixes: QTBUG-84486 Change-Id: I3e181bfa6e351dea8dfa61f8010bafb94ea8a77d Reviewed-by: Michael Brüning <michael.bruning@qt.io>