summaryrefslogtreecommitdiffstats
path: root/src/core/web_contents_delegate_qt.h
Commit message (Collapse)AuthorAgeFilesLines
* Fix compilation arm64Michal Klocek2023-11-291-0/+1
| | | | | | | | | | Add missing header include. Do not compile global setting tests as it tests so far only doh and requires ssl. Fixes: QTBUG-119525 Change-Id: I011cd3b0ed6e9d5e55e1fc80a102cc7a388681f1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Improve QWebEngineDownloadRequest::isSavePageDownload()Szabolcs David2023-09-281-3/+3
| | | | | | | | | | | | | | | | | | | WebContentsImpl::IsSavable() decides which file formats are saveable, but it allows this only for text-based files. All other files will go around on the code path of downloading. MHTML (multipart) and PDF files are saved like this, which means they aren't marked as isSavePageDownload. Just simply set this flag if the save was requested by the user even if it was a download. This fixes the flag for saving MHTML and PDF files from context menu, and leaves the flag false when a PDF download was initiated by the button of the web UI. Pick-to: 6.6 Task-number: QTBUG-114859 Change-Id: Id65f26a96952c5a43876338ad37f40570e544f3a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Switch response headers to QMultiMapAllan Sandfeld Jensen2023-08-291-1/+1
| | | | | | | | | To allow duplicate key values and preserve order within multi key duplicates Pick-to: 6.6 Change-Id: I8da0a3441255c9b72256d63f4ede10491c96c2dc Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Apply WebEngineSettings to guest viewsSzabolcs David2023-08-021-0/+3
| | | | | | | | | | | | | Animated scrolling is always enabled in the PDF viewer and can't be disabled by the settings of the embedding web view. The guest view is still not present at the time when we normally apply settings to the main WebContents, it is only possible after it was properly attached. Pick-to: 6.6 Change-Id: I6b2c99f67ad90bf028b7299280a9a8b0f31e9f65 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Adaptations for Chromium 112Allan Sandfeld Jensen2023-07-061-1/+0
| | | | | | Pick-to: 6.6 Change-Id: I1bb84b20a080d7f615bf0795ac2d97739e99ac1d Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Adaptations for Chromium 110Allan Sandfeld Jensen2023-07-061-1/+0
| | | | | | Pick-to: 6.6 Change-Id: I56e1695ee4fc2b0e12da6580a5673df80bba8b6d Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* QWebEngineLoadingInfo: Add response headersYigit Akcay2023-02-131-0/+1
| | | | | | | | | | | | | | | | | | | | This change adds a member variable that contains the response headers to QWebEngineLoadingInfo. It is filled when a QWebEngineLoadingInfo instance is constructed inside WebContentsDelegateQt::emitLoadFinished(bool). The response headers are extracted from the navigation handle when WebContentsDelegateQt::DidFinishNavigation(content::NavigationHandle *) is called. The response headers are non-empty when QWebEngineLoadingInfo::status() is equal to QWebEngineLoadingInfo::LoadSucceededStatus or QWebEngineLoadingInfo::LoadFailedStatus. Fixes: QTBUG-106862 Change-Id: I4d196e3cc71725ddad9a5832af72d1b4e50924c8 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Adaptations for 108-basedAllan Sandfeld Jensen2023-01-061-1/+1
| | | | | | | Pick-to: 6.5 Fixes: QTBUG-105147 Change-Id: I0022964903f3443cc97843c62468ab9be8ae2ed8 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* Adaptations for 104-basedAllan Sandfeld Jensen2022-11-281-2/+4
| | | | | | Change-Id: Ieb44b5c98b3342adca38916d8b77c54e8ed8e1d7 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu> Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Fix recovery after sub-process crashAllan Sandfeld Jensen2022-08-111-0/+1
| | | | | | | | | We no longer get RenderViewChanged signal but only a RenderViewReady signal after a crash. Pick-to: 6.4 Change-Id: Ib14cb3092e46e699d55bc252c9dddca524f6b8b7 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Various clean-upsPeter Varga2022-06-241-11/+6
| | | | | | 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>
* Introduce http status code domain for loading infoKirill Burtsev2022-04-181-1/+1
| | | | | | | | | | | | | | | | Fix inconsistency in reporting load info error category for http status codes, which across versions was reported either as internal error category or just no error domain. Add new separate domain for http status codes. [ChangeLog][QWebEngineLoadingInfo] Added HttpStatusCodeDomain for http status code range of errors Fixes: QTBUG-94963 Change-Id: I9fd496248c6fa33c424d758e9a0be99758aaf061 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Benjamin Terrier <b.terrier@gmail.com> Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Adaptations for Chrome 98Allan Sandfeld Jensen2022-03-291-4/+2
| | | | | Change-Id: I607604f85a111a69da77ca949dddf3399b9721b3 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* Adaptations for Chromium 94Allan Sandfeld Jensen2021-12-021-1/+1
| | | | | Change-Id: I9fb8998a3a7762b0aea70993ca231f0bbf4f7761 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Adaptations for Chromium 91Allan Sandfeld Jensen2021-12-021-1/+1
| | | | | Change-Id: Ie0236697615fd67e4f53df3dca013ce39628cc29 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Get rid of Quick's TestSupport APIPeter Varga2021-07-201-1/+0
| | | | | | | | | | | - Moved TestInputContext and TestInputEvent APIs to tst_qmltests. - Removed loadVisuallyCommitted and use Item.grabToImage to check if page is rendered. - Removed windowCloseRejected signal and use a hidden callback instead. Pick-to: 6.2 Change-Id: Ica6e4c6017426e0171d738a6a59afa557c786698 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Replace testsupport's QQuickWebEngineErrorPage with isErrorPageAllan Sandfeld Jensen2021-06-061-0/+1
| | | | | | | | | | | | | | | | 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>
* Replace FaviconManager with Chromium's Favicon ComponentPeter Varga2021-06-041-4/+0
| | | | | | Task-number: QTBUG-51184 Change-Id: Ie050cb23f2c86841a66ec384bfbcdf0713cffa7c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devAllan Sandfeld Jensen2021-05-121-8/+14
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Remove tracking of frame which load error pageKirill Burtsev2021-05-061-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It was added to suppress progress notification for error page load after failure, but since error page load is reported as a new navigation (which clears list of tracked frames), it was actually doing the opposite thing. The only situation where it suppresses progress is when navigation was not finished (due to invalid domain or network error), but in this case it was real progress change for whole load which should propagate further. Change-Id: Ifd1d681fb5c6495fb3afdc4247364afb4472c959 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
| * Fix inconsistent number of load signals and their orderKirill Burtsev2021-05-061-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change tries to match how chromium treats one single load. Before the pair of loadStarted/loadFinished methods for api classes was called on delegate's DidStartNavigation/DidFinishNavigation, which might be many within one single logical load. This is true for multiple usecases (like multiple redirects on load, immediate form submit on DOM load, page's subresource load, or just an error page load on failure). Tracking these methods and deciding when to emit signals based on states are error-prone and complicates logic for no benefits. Also it somewhat lies about when real load is done, which is only started and finished on outer methods DidStartLoading/DidStopLoading, which are conveniently called only once for all mentioned usecases. So, this change uses these methods to issue signals for load start/finish, and only makes exception for error page, which is needed for quick's private test support. Fixes: QTBUG-65223 Fixes: QTBUG-76802 Fixes: QTBUG-87089 Fixes: QTBUG-90342 Fixes: QTBUG-91773 Fixes: QTBUG-92063 Change-Id: I9cc99b639030fedd8cf6a9dc04d0869d6be6357d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* | Adaptations for Chromium 88Allan Sandfeld Jensen2021-04-151-1/+0
| | | | | | | | | | Change-Id: Ie66e95dbb9fbcafe961bb98d5c277f8c32d66b96 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devAllan Sandfeld Jensen2021-02-171-1/+5
|\| | | | | | | Change-Id: Idee0142b0e33fdf8ca663f1ef1bcd8b932985043
| * Fix loadFinished signal if page has content but server sends HTTP errorPeter Varga2021-02-051-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For triggering an error page 3 conditions should be fulfilled: - main frame navigation - the page's document is empty - the HTTP status code indicates an error This fix adds check for the empty document and sends loadFinished signal without expecting an error page if the document is not empty. Fixes: QTBUG-90517 Change-Id: I6463d75fb5e682932feca64b0f059f9aa475795c Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devAllan Sandfeld Jensen2021-01-251-10/+15
|\| | | | | | | | | | | Including update to 87-based Change-Id: I36b6054e00de97ab055d0bc800cff08d0408fac6
| * Adaptations for Chromium 87Allan Sandfeld Jensen2021-01-131-3/+8
| | | | | | | | | | Change-Id: Ic4ffd98e02f986dbaf986405360e727c813e696e Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
| * Adaptations for Chromium 86Allan Sandfeld Jensen2021-01-131-3/+3
| | | | | | | | | | Change-Id: I7e0ebecdbb68cfff0b574c966f3fa80d28680e1c Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
| * Adaptations for Chromium 85Allan Sandfeld Jensen2021-01-131-2/+2
| | | | | | | | | | Change-Id: I33c1af7c431055d95e0fb540246765cce684de15 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
| * Adaptations for Chromium 84Allan Sandfeld Jensen2021-01-131-2/+2
| | | | | | | | | | Change-Id: I359805d0bea84147fca6de2e2c7b17b4dcb17bc7 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* | Merge remote-tracking branch 'origin/5.15' into devAllan Sandfeld Jensen2020-12-111-1/+4
|\| | | | | | | Change-Id: Id1a1f4ca84697ba18e2604090e3154295fe1858b
| * Stabilize load signals emittingTamas Zakor2020-12-031-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the WebContentsDelegateQt::EmitLoadStarted() and the WebContentsDelegateQt::EmitLoadFinished() independent from the WebContentsDelegateQt::LoadProgressChanged() by removing m_lastLoadProgress. Adapt the WebContentsDelegateQt::LoadProgressChanged() to send signal only if load is in progress. Add a new test based on the bugreport. Fix qmltests::WebEngineViewSource::test_viewSourceURL() flaky tests. Fixes: QTBUG-65223 Fixes: QTBUG-87089 Change-Id: I90af4d2e85105dba801beb8102991eb4ef14c6a3 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| * Fix new view request handlingTamas Zakor2020-11-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ignore url loading if the request is not from a data url and the Q(Quick)WebEngineNewViewRequest.openIn() is not called on newViewRequested(). Set the missing Q(Quick)WebEngineNewViewRequest::requestedUrl property. Fixes: QTBUG-87378 Change-Id: Idddc9cf075db68dcf5825b3e746d16419d02cfa0 Reviewed-by: Tamas Zakor <ztamas@inf.u-szeged.hu> Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devAllan Sandfeld Jensen2020-09-141-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/3rdparty src/core/certificate_error_controller.cpp src/core/certificate_error_controller.h src/core/compositor/compositor.cpp src/core/compositor/compositor.h src/core/compositor/display_gl_output_surface.cpp src/core/content_browser_client_qt.cpp src/core/core_chromium.pri src/core/delegated_frame_host_client_qt.cpp src/core/ozone/gl_share_context_qt.h src/core/ozone/surface_factory_qt.cpp src/core/permission_manager_qt.cpp src/core/render_widget_host_view_qt.cpp src/core/render_widget_host_view_qt.h src/core/web_engine_context.cpp src/core/web_engine_settings.cpp src/core/web_event_factory.cpp tests/auto/widgets/qwebenginedownloadrequest/tst_qwebenginedownloadrequest.cpp Change-Id: Ice14c3c350b139e800c7c7011b7cef1fc7010669
| * Adaptations for Chromium 83Allan Sandfeld Jensen2020-09-091-1/+1
| | | | | | | | | | Change-Id: I63ed851426b18623d549ceaf87f1b6eeec527966 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
| * Chromium 81-based adaptationsAllan Sandfeld Jensen2020-09-091-1/+1
| | | | | | | | | | Change-Id: Ie422b327025da084bc8038c7a0aadee2db801f29 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* | Cleanup namespace issues in coreMichal Klocek2020-08-141-3/+0
| | | | | | | | | | Change-Id: Ifdffc556278fa5d133da1896600a71248662e9fa Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Simplify WebEngineCertificateErrorMichal Klocek2020-08-141-1/+2
| | | | | | | | | | | | | | | | Removes certificateErrorControllerPrivate, moves error handling logic to core. Change-Id: I050f73f1e37eb9ae39ad471fe1673d2b6140cf89 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devMichael Brüning2020-07-241-0/+1
|\| | | | | | | | | | | | | | | | | Conflicts: src/core/compositor/delegated_frame_node.cpp src/core/core_chromium.pri src/core/render_widget_host_view_qt.cpp Change-Id: I9387151e9647c87fc387095e7b6d8d66560cdf71
| * Disable navigation on back/forward mouse buttons in Qt 5Allan Sandfeld Jensen2020-07-171-0/+1
| | | | | | | | | | | | | | | | Submodule src/3rdparty 809e16e4..840c8e5f: > Make navigation on back/forward mouse buttons optional Change-Id: I191f7781cf9b824b743b80a05a3e819a414ee546 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* | Use QList instead of QVectorJarek Kobus2020-07-151-3/+3
|/ | | | | | Task-number: QTBUG-84469 Change-Id: I666a060351f73783e15e3f96884c9393a5cd7e46 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Restore behavior of OpenURLFromTab if createWindow returns thisJüri Valdmann2020-04-261-1/+4
| | | | | | | | | | | | Instead of using QSharedPointer's reference count to communicate adoption/non-adoption, change adoptNewWindow to return a adapter pointer, with null meaning non-adoption. Then change QWebEnginePage's implementation to reuse already existing adapters if possible, restoring previous behavior of OpenURLFromTab when createWindow returns this. Task-number: QTBUG-80596 Change-Id: I8ee7c31e4294aabd3207c504cba67d6171c66cb0 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Implement WebContentsDelegate::ContentsZoomChangeAllan Sandfeld Jensen2020-04-221-0/+1
| | | | | | | | Needed to do wheel zoom. Fixes: QTBUG-83656 Change-Id: I97d96585b7f760487daa292ad279805007c5095e Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Join some features request and response functionsAllan Sandfeld Jensen2020-04-151-2/+1
| | | | | | | Will make it easier to expands with more features in the future Change-Id: Ic7c1aca23a543c95a4873471c918f74606be2053 Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
* Adaptations for Chromium 80Allan Sandfeld Jensen2020-04-071-1/+1
| | | | | Change-Id: Icaf68648cbc2c13a61fc3b208ff1e64ca36c90b6 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* Adaptations for Chromium 79Allan Sandfeld Jensen2020-02-281-1/+1
| | | | | | | | Fixes: QTBUG-80737 Fixes: QTBUG-81556 Fixes: QTBUG-81614 Change-Id: Ie6a69cdbf46d0508bff226f1b8fed28a618e1949 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Rework url changed logicMichal Klocek2020-01-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | Due security changes to prevent url spoofing, our implementation is getting extra invalidate url requests. Unfortunately, this breaks our url handling, which now gets lots of new back and fort url changed signals and make several unit test failures. After tedious investigation of Chromium omnibox handing and trying out different approaches, it seems that only sensible solution is to follow Chromium logic and make NavigationStateChanged to update 'ui' in asynchronous matter. This change tries not break any tests and simplify url handling. The only side effect of this change is that WebEnginePage::setContent will get extra 'url' signal of initial 'urlData' and later 'baseUrl' change is emitted. Fix one of qml tests which did not expect to have url on LoadStartedStatus. Task-number: QTBUG-63388 Task-number: QTBUG-48995 Change-Id: Id347f4325c036e16bfae7bf2f694905e0f21f8d7 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Adaptations for Chromium 77Allan Sandfeld Jensen2019-10-111-3/+3
| | | | | | Fixes: QTBUG-77267 Change-Id: I181e24cf80ebee6991b95dde6c636f0d169b40a4 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* Adaptations for Chromium 76Allan Sandfeld Jensen2019-10-111-1/+2
| | | | | Change-Id: Id6d18a3854b572334dc1d65f1916b8991a740cd2 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* Refactor findText handlingPeter Varga2019-08-221-6/+3
| | | | | | | | | | | Move most of the findText logic to the QtWebEngineCore::FindTextHelper class. This change also separates findText callbacks in the new class for getting rid of the request ID conversion and make it easier to remove them in Qt6. Task-number: QTBUG-50420 Change-Id: I348cedd0f90a49f9b360165c46319aeed2c236c0 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>