summaryrefslogtreecommitdiffstats
path: root/src/webengine/api
Commit message (Collapse)AuthorAgeFilesLines
* Keep page's zoom level on loading new urlsKirill Burtsev2022-06-012-6/+13
| | | | | | | | | | | | 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. 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> (cherry picked from commit 1e27d42a8071532b6cc30a9bcc5f700edc56952a)
* Do not access accessibility from qt post routinesMichal Klocek2021-11-251-1/+4
| | | | | | | | | | | | | | | | | | | | It seems accessing accessibility from qt post routines ends badly since caches are gone already. Add closingDown() function to web context, which is similar to QCoreApplication::closingDown(), however return true on post routine. Guard delete accessibility calls. Note the widget part is not necessary, but added for completeness, since only qml can release profiles due to garbage collection. Fixes: QTBUG-90904 Change-Id: Ic0e7115cd17eb58f3d58f70fefbc197dfb7a6493 Reviewed-by: Michael Brüning <michael.bruning@qt.io> (cherry picked from commit 89bb3c97eee9cd4bf9fb536f024715e606e49ae0) Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fix inconsistent number of load signals and their orderKirill Burtsev2021-05-062-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Depend on QCoreApplication::startingUp() for checking existence of appAndy Shaw2021-04-121-2/+1
| | | | | | | | | | | | | When using QtWebView with WebEngine then it will hook the call to QtWebEngine::initialize() to the start up of the application object which means it will output the warning because it already exists. However there is still time at this point to set what is needed because it is still being initialized. So by checking if the application is running (i.e. !startingUp()) then we can be safe in knowing that it is still able to do the initialization. Change-Id: I8c5d8808b4b09e1e7bbf4be52e5efc0786ce1472 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Notify canGoBack/canGoForward changes based on web actionsJüri Valdmann2021-03-222-2/+9
| | | | | | | | | | | | | | | Before, QQuickWebEngineView's canGoBack/canGoForward change signals are based on urlChanged. But the urlChanged signal may be emitted slightly before the value of canGoBack/canGoForwad actually changes, resulting in a missed change notification. After, they get their own signals, which are forwarded from the QQuickWebEngineAction::enabledChanged signal of the respective web actions. Fixes: QTBUG-91565 Change-Id: Id411eb146c776e2824fd2447660e8857974da32e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fix mad popup qquickwindows on waylandMichal Klocek2021-02-161-1/+2
| | | | | | | | | | | | | | | | | | | | On wayland with weston the popup quickwindow should have parent otherwise it gets into 'mad' mode and jumps around the screen. This also fixes similar issue on some embedded x11 setups. Adding parent brakes positioning of popups, but the fix is done in followup patch. This patch also has a regression, closing application during opened comobox will cause crash, however before this patch application simply did not remove render process or "hanged" on exit. This issue is also handled in follow up patches. Change-Id: I876b9a5b58a731eee95f30a52a3c2705730631da Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fix build with Qt 5.12Allan Sandfeld Jensen2021-02-151-1/+1
| | | | | | | No QMap::insert as set or append. Change-Id: Icb05e43c4cb3d45171a164bdda7420d066eab79e Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* Fix loadFinished signal if page has content but server sends HTTP errorPeter Varga2021-02-052-2/+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>
* FIXUP: Doc: Describe the WebEngineView.LoadStoppedStatus enum valuePeter Varga2021-02-031-3/+6
| | | | | | | | | Add description for the WebEngineLoadRequest QML type too. Task-number: QTBUG-57636 Change-Id: I021af3c49e8235b04ce60efa6143b2e547fc65ad Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Fix blank popups in qmlMichal Klocek2021-01-181-0/+1
| | | | | | | | | | | In qml when on platforms without windowing system we need to send show notification. Note this was not required with old compositor, since it was hooked up differently than viz. Task-number: QTBUG-86034 Change-Id: I3ecdc033802d59c15637bc0e48961cd7748b1c6b Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fix some warningsPeter Varga2021-01-161-1/+1
| | | | | Change-Id: Ic7cff2556945272761288fedd271796dbf240cb5 Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
* Adaptations for Chromium 85Allan Sandfeld Jensen2021-01-131-4/+12
| | | | | Change-Id: I33c1af7c431055d95e0fb540246765cce684de15 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* Fix leak in QQuickWebEngineViewPrivate::contextMenuRequestedAllan Sandfeld Jensen2021-01-121-1/+1
| | | | | Change-Id: Idb41daa68709c769330527a713689241ac073359 Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
* Fix favicon engine under device pixel scalingAllan Sandfeld Jensen2020-09-221-2/+21
| | | | | | | | The QIcon::pixmap function does internal scaling messing up our intermediate structures. Change-Id: I727efd58a4cc948fa3e4b23539d97e8ca755d060 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* Avoid to reject a certificate error twice in QuickPeter Varga2020-09-161-0/+6
| | | | | | | | Widget API already ignores these cases. This would cause a crash for fatal certificate errors after 83-based. Change-Id: I3e80bb12f023f22e330218a5b20f3e267bb237dc Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Ignore QQuickWebEngineNewViewRequest if it is unhandledTamas Zakor2020-08-253-0/+6
| | | | | | | | | | | | This is the case when the WebEngineNewViewRequest.openIn() is not called on newViewRequested(). For example, when opening the view source from context menu in quick minimal example. Fixes: QTBUG-85494 Change-Id: I7c1ae53684361de459b2f268e471904e632821b0 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fix suggest-override warningsAllan Sandfeld Jensen2020-08-184-8/+8
| | | | | | | Also violates modern Qt code style Change-Id: Ibb12b6db18bbd2669377abe1d25034ed69a86389 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* Delete unused function editorActionForKeyEventJüri Valdmann2020-05-251-2/+0
| | | | | | | Change-Id: I5fe08380e297cdf8138df0b49b3c82e741f54dd1 Pick-to: 5.15 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 3472641433d0adab3caea008f047aac9637828c4)
* Add support for clearing the feature requestAllan Sandfeld Jensen2020-05-201-4/+6
| | | | | | Task-number: QTBUG-83476 Change-Id: I63ad9801e3e97f7fdac959600c69c04d0105be1f Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
* Fix setting WebEngineView.audioMuted before initializationJüri Valdmann2020-05-052-3/+11
| | | | | | Fixes: QTBUG-83732 Change-Id: Ie07a1ecf87b214436ab7cea07003ddd5aeaedda3 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Revive Pointer Lock featureSzabolcs David2020-05-041-4/+1
| | | | | | | | | | | | | | | This change fixes several issues: - Accepting mouse lock permission from modal dialog was not working on Linux. XCB needs some time to activate the parent window after accepting the dialog and we expected to have immediate active focus. - Implementation of RenderWidgetHostViewBase::IsMouseLocked() was missing. - Fixed event.movementX/movementY by disabling ConsolidatedMovementXY feature. Calculate movement properties in WebEngine instead of blink. Task-number: QTBUG-83294 Change-Id: Ic03d05c1026a113cf5e8d22544fc508d9f285876 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Restore behavior of OpenURLFromTab if createWindow returns thisJüri Valdmann2020-04-262-4/+10
| | | | | | | | | | | | 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>
* Join some features request and response functionsAllan Sandfeld Jensen2020-04-152-9/+17
| | | | | | | Will make it easier to expands with more features in the future Change-Id: Ic7c1aca23a543c95a4873471c918f74606be2053 Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
* Merge remote-tracking branch 'origin/5.14' into 5.15Allan Sandfeld Jensen2020-04-101-2/+6
|\ | | | | | | Change-Id: I75f7bbf5e5a4d4ed3bf7bfbfb76162de8a89e6fa
| * Doc: Fix docs for playbackRequiresUserGesture WebEngine settingLeena Miettinen2020-04-021-2/+6
| | | | | | | | | | | | Fixes: QTBUG-83101 Change-Id: I7ca8271cc88c7e157c36c79e06fa378f4bce48e4 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Adaptations for Chromium 80Allan Sandfeld Jensen2020-04-072-0/+5
| | | | | | | | | | Change-Id: Icaf68648cbc2c13a61fc3b208ff1e64ca36c90b6 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Allan Sandfeld Jensen2020-03-032-2/+14
|\| | | | | | | | | | | | | Conflicts: tests/auto/quick/qquickwebengineview/BLACKLIST Change-Id: I365daa73d2eb422ac916c32b86c5ad0d3c32086d
| * Invalidate accessible interfaces on destruction of view or pagePeter Varga2020-02-272-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The RenderWidgetHostViewQtDelegate(Widget|Quick)Accessible interfaces are forwarding their queries to the WebEngineView. In case of widget, the view also forwards the query to the page. The accessible interfaces may outlive the view and page. The interfaces are not supposed to be used after the destruction of the underlying objects. Thus, set the RenderWidgetHostViewQtDelegate and WebEngineView accessible interfaces invalid if the corresponding pointers are null. Also fix querying the root accessible interface of the web page when the render frame host is not available. This fixes crash when QT_LOGGING_RULES="qt.accessibility.cache.debug=true" is set and logger tries to pretty-print QAccessibleInterfaces during destruction. Task-number: QTBUG-78284 Change-Id: If18af0605061fcd82d019d0042dbf1c9d3a910be Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Allan Sandfeld Jensen2020-02-192-8/+24
|\| | | | | | | | | | | | | | | | | Blacklisted one test requiring an update of qt5.git. Conflicts: .qmake.conf Change-Id: I75e55a1c5f8840cde55ddb60d632287b2affadeb
| * Fix quick accessibility on macOSPeter Varga2020-02-172-8/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | Same as the widget fix: ffdf7ece Fix widget accessibility on macOS This patch depends on a focusChild() fix in qtdeclarative: 6420ad91d3 Fix QAccessibleQuickWindow::focusChild() to return focused descendant Task-number: QTBUG-78284 Task-number: QTBUG-81539 Change-Id: If0da937d2c778a158ce02e1433b28ca0888692d8 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Add getter/signal to get the render process PIDFlorian Bruhin2020-02-013-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | This can useful for e.g. implementing something like the "Task manager" in Chromium or otherwise interacting with the render process (e.g. to kill it for some reason while debugging). [ChangeLog] Add a renderProcessPid() getter to (Q)WebEnginePage which allows getting the process ID of the underlying render process. Change-Id: Id5d59be9b6bd46ffc3a6aa480cb5ff7bd3b8aa31 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Add clear method to QQuickWebEngineHistoryJüri Valdmann2020-01-302-0/+15
| | | | | | | | | | | | Fixes: QTBUG-71619 Change-Id: I35c5ecbbe78da3114d30945f8ce030937e17d98e Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* | Fix deprecation warningsKirill Burtsev2020-01-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | Suggested changes: * endl -> Qt::endl * {} for default QFlags * QString -> QStringLiteral for QStringList::join * QNetworkReply::error -> networkError Change-Id: I03919ab0675a9beb64bd176e6c681a338b08b51e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge "Merge remote-tracking branch 'origin/5.14.1' into 5.15"Michael Brüning2020-01-175-25/+36
|\|
| * Rework url changed logicMichal Klocek2020-01-142-16/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * Fix Q(Quick)WebEngineDownloadItem::setDownloadDirectory()Tamas Zakor2019-12-183-9/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Keep the custom file name if the calling order of setDownloadDirectory() and setDownloadFileName() changes. Also do not emit patchChanged signal twice if setDownloadDirectory() changes the uniquifier of the file name. Add TempDir for qml auto tests what uses QTemporaryDir() to create temporary directory for downloads. See https://cgit.kde.org/messagelib.git/commit/?id=2c113dcb155b11bf2c0af3c85544962485784b26 for details. Fixes: QTBUG-80566 Change-Id: Ia76f263558eaf55cb297700407948523788c6229 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Fix QFlags warningsAllan Sandfeld Jensen2020-01-171-1/+1
|/ | | | | Change-Id: I2938d5a44df01c7d9c70e18ecc293fc91079e5bd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Merge remote-tracking branch 'origin/5.14.0' into 5.14Allan Sandfeld Jensen2019-12-043-3/+5
|\ | | | | | | Change-Id: I4f73d4b11bee795185d4eaae718d4cfdb3112100
| * Fix 'setDownloadDirectory' for download item on 'SavePage' actionKirill Burtsev2019-11-293-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Chromium's DownloadManager doesn't create its download items before path for saving page is confirmed. So assert inside updateDownloadPath was not correct. Moreover, the name is confusing because it's not really updating anything. Remove it and use ProfileAdapterClient::DownloadInfo timestamp to determine updated filename after directory change. Ammends recent new api for changing download directory 0884fab3b1. Fixes: QTBUG-80372 Change-Id: If9efb52979deb3cf21fc4e12989173c85e04e090 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* | Fix regression in alt attribute of copied image urlsAllan Sandfeld Jensen2019-11-301-7/+19
|/ | | | | | | | The linkText hasn't had the alt attribute for a long time, so instead add direct support for contextual title and alt text. Change-Id: I88e1c43374d855da7fb0d1ca42c0eb474012f0f2 Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
* Merge remote-tracking branch 'origin/5.13' into 5.14Allan Sandfeld Jensen2019-10-221-3/+12
| | | | | | | | | | | Conflicts: examples/webengine/minimal/main.cpp src/3rdparty src/core/net/url_request_custom_job.cpp tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp Change-Id: I33994024a4be5ed787800c5718a0a443b970c36d Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* QML: Use revision 10 for import 1.10Kai Koehne2019-10-211-6/+6
| | | | | | | This makes reviewing API etc easier. Change-Id: Ib6cfa74cb130cf1085d6af24eaaa0b9cf403889b Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QML: Fix import to 1.10Kai Koehne2019-10-171-5/+5
| | | | | | | | | | New QML API in Qt 5.14 should be made available under import QtWebEngine 1.10 Change-Id: Ia421755eaa77f283d7a23b4b2b3b3ea1a491714d Reviewed-by: Michael Brüning <michael.bruning@qt.io> Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* Improve Q(Quick)WebEngineDownloadItem APITamas Zakor2019-10-072-7/+10
| | | | | | | | | | Implements suggestions from 5.14 API review: - Replace QString with const QString & - Extend documentation Change-Id: I08365767128aa72bc7ef2356c761c2abe512e4eb Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Merge remote-tracking branch 'origin/5.13' into 5.14Allan Sandfeld Jensen2019-09-243-7/+9
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config.tests/glibc/glibc.cpp src/3rdparty src/core/configure.json src/core/profile_io_data_qt.cpp src/webengine/configure.json src/webenginewidgets/api/qwebenginepage.cpp tests/auto/widgets/qwebenginepage/BLACKLIST Change-Id: I3e1781048c3cb09bfbf7427dfc5dd1fec11a2b97
| * Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-09-121-1/+1
| |\ | | | | | | | | | | | | | | | | | | Conflicts: src/3rdparty Change-Id: Ib1202bcce587f9614013105c6a836344c1727cb7
| | * Reject certificate error for non-overridable errorsKirill Burtsev2019-08-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On certificate validation error page load is just halted meaning that no progress or load result are reported and no default error page for certificate errors is shown. Even though documentation states that 'By default, an invalid certificate will be automatically rejected' and that aligns with default implementation of certificateError method within Page and non-deferred errors in quick View, page or view silently stays in an intermediate state for non-overridable errors. Fix this inconsistent behavior by automatically rejecting certificate for every invalid case (non-overridable error, not deferred or not implemented overridable method). Change-Id: Id1cee2ee5cc45bdcb5f262a6c99c84274e6ca374 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
| * | Fix doc of QQuickWebEngineSettings::fullScreenSupportEnabledJüri Valdmann2019-09-091-1/+1
| | | | | | | | | | | | | | | | | | Fixes: QTBUG-78091 Change-Id: I65c8c39625955782c157b6360f92aa3a7e1c8c1b Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
| * | Fix invalid url on profile changeMichal Klocek2019-09-041-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | If adapter is initialized use always active url. Fixes: QTBUG-77977 Change-Id: Ie8d4ec7d7c703322cef50d26931cce2b130dcf34 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| * | Add doc's cross-references for web notification example and api methodsKirill Burtsev2019-08-291-2/+6
| | | | | | | | | | | | | | | Change-Id: If5a2d6a15a282a83e47e2bfb3d7e1a2a7c9a50fa Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>