summaryrefslogtreecommitdiff
path: root/src/core/api/qwebenginepage.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Test for presence of local frame in runJavaScriptAllan Sandfeld Jensen2023-05-161-2/+8
| | | | | | | | | 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>
* Better handling of interrupted PDF printingSzabolcs David2023-04-051-0/+5
| | | | | | | | | | | | | | | | | | | | | - Document the fact Stop WebAction can interrupt the in-progress PDF generation. - Update PrintViewManagerQt::PrintPreviewDone(): Normally IsPrintRenderFrameConnected() implies IsRenderFrameLive(), but we have to check both to avoid crash when render process exits. (Like Chrome does.) - Update PrintViewManagerQt::RequestPrintPreview(): Handle that case when print preview params were sent between processes at the beginning, but it was interrupted before RequestPrintPreview() could start PDF generation. - Add a simple auto test to catch crashes Pick-to: 6.5 Task-number: QTBUG-108154 Change-Id: I8a4f9cc97ddcf9a165d66a5981d93a023858fbc1 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QWebEngineUrlResponseInterceptor: Implement new URL response interceptorYigit Akcay2023-03-101-0/+20
| | | | | | | | | | | | | | | | | | | | | 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 <michael.bruning@qt.io>
* Support LTR and RTL text directions in input fieldsSzabolcs David2023-02-151-0/+12
| | | | | | | | | | Implement WebActions to temporarily change text direction directly from context menu - like Chrome does. They only work for the selected input field. Omit the "default" option since it is always grayed out in Chrome. Task-number: QTWB-67 Change-Id: I4bacbd82c6bd7261ac465eec9da3776613f98074 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add touchSelectionMenu for widgetsMartin Negyokru2022-12-121-0/+20
| | | | | | | | | [ChangeLog][QWebEngineWidgets] Added touch selection menu. Task-number: QTBUG-100418 Task-number: QTBUG-91712 Change-Id: Iffb994e429b92389e64cd6a93a0b034d6aa07f66 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Deprecate Quota Permission Request APIPeter Varga2022-12-081-11/+5
| | | | | | | | | | | | | | | | | | | | | | | | Requesting host quota is no longer supported by Chromium. navigator.webkitPersistentStorage has became an alias for navigator.webkitTemporaryStorage after the Chromium 106 update. Requesting quota for temporary storage is needless because the allocation is automatic and storage can't be requested beyond the maximum limit. The logic of the persistent storage will be entirely removed in the next Chromium update so just deprecate the API and remove the corresponding implementations. [ChangeLog][QtWebEngineCore] Deprecate QWebEnginePage::quotaRequested() signal and QWebEngineQuotaRequest class. The signal is not emmitted anymore. [ChangeLog][QtWebEngineQuick] Deprecate QWebEngineView.quoataRequested() signal. The signal is not emitted anymore. Task-number: QTBUG-56354 Change-Id: Ie397598c416d9e811270ba56a97f8984948277f7 Reviewed-by: Szabolcs David <davidsz@inf.u-szeged.hu> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-071-2/+2
| | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace. Task-number: QTBUG-99313 Change-Id: I4b5f85df579532c2af938fe70db945ba273782fb Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add touchHandles for widgetsMartin Negyokru2022-08-291-0/+6
| | | | | | | Task-number: QTBUG-100418 Task-number: QTBUG-91712 Change-Id: I69131d3c7c4511ea3114df7a9300bf6ff1a59fee Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Various clean-upsPeter Varga2022-06-241-1/+4
| | | | | | Pick-to: 6.4 Change-Id: I53e04a247a25149d9f29135484c0528c706de7d8 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* 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 <joerg.bornemann@qt.io>
* Remove widget from QWebEnginePagePrivateAllan Sandfeld Jensen2022-06-221-4/+4
| | | | | | | | | It is redundant with item->m_widgetDelegate, once a few inconsistencies were ironed out. Pick-to: 6.4 Change-Id: I18a90cc195e5854d8421aa8c0951872322b78d28 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* Support HTML5 <datalist> elementPeter Varga2022-06-191-0/+14
| | | | | | | | | | | | | | | | | The datalist uses Chromium's autofill component to fetch and filter predefined options in the list and autocomplete the field with the selected option. Autofill component is added to build and bound to WebEngine. All the unnecessary autofill features for datalist are supposed to be disabled: payment/credit card support, password manager, save profile data, store suggestions in database etc. Custom popups for the dropdown are implemented for Widget and Quick. Scrolling in dropdown is not implemented in this change. Fixes: QTBUG-54433 Pick-to: 6.4 Change-Id: I155d02d6dbc9d88fbca4bc5f55b76c19d0ba7a9d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Switch from QT_NO macros to feature checksAllan Sandfeld Jensen2022-06-101-6/+6
| | | | | | | | | | | This is safer by ensuring we are checking for a feature that is defined. For some reason, the openssl feature is a private feature, so we need to include the private header to access it. Pick-to: 6.4 Change-Id: Idf7f3baba33e5188f206f5be1b8a0bfd75e79d03 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Create a RWHV delegate in coreAllan Sandfeld Jensen2022-06-091-46/+12
| | | | | | | | | | This is adapting the Quick code for shared use with widgets, and allows us to use it from QWebEnginePage. Pick-to: 6.4 Fixes: QTBUG-96377 Change-Id: I3f09c1a949eff86d80fbe6c513dc66e3f9f2f611 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Implement File System Access permission APISzabolcs David2022-05-261-0/+8
| | | | | | | | | | | | Allow web pages to safely access the local file system by exposing a permission API. Permissions are stored in-memory. The built-in access rules are the same as the behavior of Chrome: JS can't request access to system libraries, sensitive directories and the application itself. Task-number: QTBUG-97829 Change-Id: Ic675422cafbad5a90243b4fa8f0749c46afa192c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Keep page's zoom level on loading new urlsKirill Burtsev2022-05-151-1/+11
| | | | | | | | | | | | Ammends d236c5a8a3. Zoom level was set as a temporal one, which is invalidated each time when a renderer process or widget are changed (on new navigation, for example), so it needs to be reapplied. Pick-to: 6.3 6.2 5.15 Fixes: QTBUG-101030 Change-Id: Iecff9686fbe2b79e99b46f67cab92f66127be085 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Fix a few code checker warningsAllan Sandfeld Jensen2022-03-301-1/+1
| | | | | Change-Id: I0eb2cb362759e9a02a61993574906fc1e4b8ffeb Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
* Avoid crashing on context free web actionsAllan Sandfeld Jensen2022-03-241-15/+15
| | | | | | | | | | If a web action that depends on a context is called, do nothing instead of crashing. Pick-to: 6.3 6.2 Fixes: QTBUG-101724 Change-Id: I7a0040a58e9dc7fa14f0cae71cf1bcd086b61c54 Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
* Widgets: Add FileSelectionMode::FileSelectSaveSzabolcs David2022-01-191-0/+1
| | | | | | | | | Now we have an example to trigger this type of dialog, we can expose this as public API. Pick-to: 6.3 Change-Id: If0964d07a532daaff5e798dac63dc02ec7781d4d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Cleanup code and clang build warningsKirill Burtsev2022-01-021-2/+0
| | | | | | | | | Fix build noise as reported by clang for issues like api deprecation, unused variables, sign/unsigned mismatch and other non critical issues. Pick-to: 6.2 Change-Id: I4fba25406eea8170e3283c42e908ae86bd512e3a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Update documentationAllan Sandfeld Jensen2021-12-071-2/+0
| | | | | | | | | The signal is updated much faster for paused media now. Pick-to: 6.2 5.15 Fixes: QTBUG-98918 Change-Id: Ifa3b54e212436a7c93e101dc244d7edcbf473b63 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Fix drag and drop againAllan Sandfeld Jensen2021-09-101-2/+2
| | | | | | | | | | Return the right QObjects Fixes: QTBUG-96308 Change-Id: If04be10fe19db6b8c0552c7df588961c711c1250 Reviewed-by: Michael Brüning <michael.bruning@qt.io> (cherry picked from commit e85e4ab275fb0a0c072f19ed3d5c5b5b46de8321) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix handling of new window requestKirill Burtsev2021-09-051-26/+9
| | | | | | | | | | | | | | | | | | | | Fixes heap-use-after-free for WebContentsAdapter, which is replaced in the case, when new window set to be opened and adopted by the same page, which triggered this request: for example, when 'this' is returned by 'createWindow' override. Achieve this by scheduling 'deleteLater' on an old adapter. This was already implemented that way for internal 'adoptWebContents', but was overlooked for page's 'createWindow' API. So just unify handling logic. Also, adapt 'customUserAgentInNewTab' test, since adopting existing WebContents from different profile is not supposed to work, and now enforced by the check in 'adoptWebContents'. Unfortunately, test should also be blacklisted, since it's appeared that custom user agent is still not reliably set for newly created window. Task-number: QTBUG-76249 Fixes: QTBUG-94772 Pick-to: 6.2 Change-Id: Ic9dff33eae99cc242a294d45a92be96306cef93d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Update documentation notes for build with WebEngine modulesKirill Burtsev2021-08-171-2/+2
| | | | | | | | | | Add cmake usage snippets for module's libraries. Remove quick version from code snippets. Fix minor documentation warnings. Fixes: QTBUG-94937 Pick-to: 6.2 Change-Id: I2e5c8616ceeab495f604e135bb2aa2261c50c68d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Return printToPdf to QWebEnginePageAllan Sandfeld Jensen2021-08-091-1/+95
| | | | | | | | | It doesn't use QPrinter and can be done using QtGui classes only. Pick-to: 6.2 Change-Id: I0e14563c1bb5e93d9803bb1a807f702b1a2a5315 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
* Add QWebEngineNewWindowRequest::openIn(QWebEnginePage *)Allan Sandfeld Jensen2021-07-211-5/+3
| | | | | | | | Makes for a nicer API Pick-to: 6.2 Change-Id: I15e72d526e9cf6cf9ca8bd3e24f5dd7e7b2e9fa5 Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
* WebEngineNavigationRequest: add accept/reject and deprecate setActionKirill Burtsev2021-07-211-6/+3
| | | | | | | | | | | | Match naming with others and use accept/reject methods to handle request. Also, allow to use request object after call scope in QML. [ChangeLog][QWebEngineQuick][WebEngineNavigationRequest] setAction(action) is deprecated in favor of new accept/reject methods Pick-to: 6.2 Change-Id: I83252370e2e83017008f6951f98b7ecad119e232 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Bump copyrightsAllan Sandfeld Jensen2021-07-141-1/+1
| | | | | | Pick-to: 6.2 Change-Id: I8eb8bfba45abb340816b8c2072cca4486c1f37ab Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* Remove one more redundant function definitionAllan Sandfeld Jensen2021-07-141-13/+6
| | | | | | Pick-to: 6.2 Change-Id: I45bb1ab74fd15cae9c84262f3887c2ebbef23c3b Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
* Update parameters to findText callbackAllan Sandfeld Jensen2021-07-131-2/+2
| | | | | | | Pick-to: 6.2 Change-Id: I622ff55c1c9b6f9d4818228c75543c3deffa37be Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* Get rid of private methods of QWebEngineNewWindowRequestPeter Varga2021-07-121-4/+5
| | | | | | Pick-to: 6.2 Change-Id: I40072b45ceffa1a2c92027a4c01239974b8ac498 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Get rid of a few redundant method variantsAllan Sandfeld Jensen2021-07-091-31/+1
| | | | | | | | | Use default arguments to get rid of the old method version without breaking API. Pick-to: 6.2 Change-Id: I2f71b04bff491567df564c66cd98d0d04bfa0517 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Clean up includes, forward declarations and friends in core apiPeter Varga2021-07-081-4/+0
| | | | | | Pick-to: 6.2 Change-Id: I58e2dc2443bca75b0d315694c9f6503251a7be02 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Doc: Fix documentation issues for Qt WebEngineTopi Reinio2021-07-011-12/+15
| | | | | | | | | | 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ö <topi.reinio@qt.io>
* Add page() and view() back to download-itemAllan Sandfeld Jensen2021-06-211-4/+0
| | | | | | | | Restores a QML type but this time derived from the core type. Pick-to: 6.2 Change-Id: I09ddb6672f7262ae31e4c57f09d019f71abccd41 Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
* Add API for favicon databasePeter Varga2021-06-181-4/+5
| | | | | | | | | | | | [ChangeLog][QtWebEngineCore][QWebEngineProfile] Add new API to access icon database asynchronously. [ChangeLog][QtWebEngineQuick] image:/favicon/ URLs now can be used to access icon database. Pick-to: 6.2 Task-number: QTBUG-51184 Change-Id: I6096ad9a4210670ed59458c4fa099a02595e8a1e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Switch QWebEngineCallbacks in QWebEnginePage to std::functionAllan Sandfeld Jensen2021-06-171-24/+46
| | | | | | Pick-to: 6.2 Change-Id: I5b0c1c7ef0966c3cff79184aa0733b59208d6890 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Fix some compiler warningsPeter Varga2021-06-101-4/+6
| | | | | | | | | | | | | - 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 <allan.jensen@qt.io>
* Replace Q_NULLPTR and pointer 0 with nullptrAllan Sandfeld Jensen2021-06-101-1/+1
| | | | | | Pick-to: 6.2 Change-Id: Ifd7acf49b22be1532ba98371982af4b14f08e6fc Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* Switch QWebEnginePage::findText() to std::functionAllan Sandfeld Jensen2021-06-101-2/+3
| | | | | | | | | Leaving further API modification for later Pick-to: 6.2 Task-number: QTBUG-63235 Change-Id: I75367ee5d4ce071abaeed361d2dc27c64fb6dd8a Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* QWebEnginePage: add new 'loading' property and expose QWebEngineLoadingInfoKirill Burtsev2021-06-081-5/+23
| | | | | | | | | | [ChangeLog][QWebEngineWidgets][QWebEnginePage] QWebEngineLoadingInfo is now exposed on loadingChanged signal with new 'loading' property Fixes: QTBUG-53333 Task-number: QTBUG-61100 Change-Id: I7773030726faeb1d65cc85a4d688a80f6dbe2c80 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Replace testsupport's QQuickWebEngineErrorPage with isErrorPageAllan Sandfeld Jensen2021-06-061-16/+5
| | | | | | | | | | | | | | | | Merge and unify handling of loading started/finished for quick and widgets by removing separate quick's type for monitoring error page load and replace it with an isErrorPage method in WebEngineLoadRequest to indicate, that load ended with an error page being displayed. Effectively this only slightly changes when loading finished gets emitted: now the signal is just postponed until error page is finished loading after initial failure. [ChangeLog][QWebEngineQuick][WebEngineLoadingInfo] New property 'isErrorPage' which indicates that the load resulted in an error page Change-Id: I3e59dc488429d776f7c8e083b6d0489fb30a65fc Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Merge WebEngineHistory's quick implementation into QWebEngineHistoryKirill Burtsev2021-06-041-4/+2
| | | | | | | | | | [ChangeLog][QWebEngineCore][QWebEngineHistory] New methods to access navigation history as a model through new class QWebEngineHistoryModel. [ChangeLog][QWebEngineQuick] QQuickWebEngineHistory is merged into QWebEngineHistory. Task-number: QTBUG-74585 Change-Id: I9f9a73bbaf3954282dfc220cfc2c4cb08a37fb73 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Replace FaviconManager with Chromium's Favicon ComponentPeter Varga2021-06-041-3/+2
| | | | | | Task-number: QTBUG-51184 Change-Id: Ie050cb23f2c86841a66ec384bfbcdf0713cffa7c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Move QQuickWebEngineNavigationRequest to CoreAllan Sandfeld Jensen2021-06-041-0/+19
| | | | | | | | | Adds navigationRequested() to QWebEnginePage and exposes more information about navigation requests than the old acceptNavigationRequest() method. Change-Id: Ibb8d750bacd1060c3086ffe2c85336abd216bab0 Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
* Drop printsupport dependency from coreSzabolcs David2021-06-031-179/+7
| | | | | | | | | Prevent linkage of core to widgets by moving printing API from QWebEnginePage to View and using QPagedPaintDevice (the QtGui ancestor of QPrinter) where it's needed. Change-Id: I6ea96edb495b0dcaaa584bbe72632fda025c18d3 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Move createWindow to a signalAllan Sandfeld Jensen2021-06-031-42/+153
| | | | | | | | | | | | | | Ports QQuickWebEngineNewViewRequest to QtWebEngineCore. [ChangeLog][QtWebEngineQuick][WebEngineView] WebEngineView::NewViewRequested is now handled with WebEngineView::acceptAsNewView() instead of with WebEngineNewViewRequest::openIn(). Task-number: QTBUG-74587 Change-Id: I9b27128948076e13f2c228458e1e7491df12153d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Add missing FileSelectionMode enum valueBalazs Egedi2021-05-311-0/+1
| | | | | | | FileSelectUploadFolder value is added. Change-Id: Ie69782234bcbf3460d2999ac08ee9f88dea190c7 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Make handling of certificate errors possible from a signalAllan Sandfeld Jensen2021-05-251-3/+1
| | | | | | Task-number: QTBUG-74587 Change-Id: I9955a4c70b339523b5e9e9d6dffe928e61fbab90 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devAllan Sandfeld Jensen2021-05-121-13/+9
| | | | | | | | | | | | | | | | | | Conflicts: examples/webenginewidgets/printme/printhandler.cpp src/3rdparty src/core/api/qwebenginepage_p.h src/core/content_browser_client_qt.h src/core/web_contents_adapter_client.h src/core/web_contents_delegate_qt.cpp src/core/web_contents_delegate_qt.h src/webenginequick/api/qquickwebengineview_p_p.h tests/auto/quick/qmltests/data/tst_download.qml tests/auto/quick/qmltests/data/tst_viewSoure.qml tests/auto/widgets/loadsignals/tst_loadsignals.cpp tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp Change-Id: I9c1819ec15e13d4f8e244defe860e26274b5d4be