summaryrefslogtreecommitdiffstats
path: root/src/core/web_contents_adapter.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
| * Abort findText also right on explicit navigation requestKirill Burtsev2021-03-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Current implementation cancels current findText only when new navigation is accepted (since it may be rejected all together), so it's not guaranteed that user code will not receive completion callback if it arrives after explicit load/setContent/setHtml but before acceptNavigationRequest. For explicit navigation it doesn't make sense to wait until it's accepted, since it's only exposed there just for consistency, and an expectation for findText is that it should be canceled on new navigation. Fixes: QTBUG-61887 Change-Id: Ia2e19df3b5712e6b5426443d1bce6b205e186668 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* | Merge remote-tracking branch 'origin/5.15' into devAllan Sandfeld Jensen2021-03-161-1/+9
|\| | | | | | | Change-Id: I0dd7c64669f4b130047a4a3836f62f7ee5b5f8d9
| * Show PDF viewer in a guest viewSzabolcs David2021-03-061-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the basic support of guest views, implemented based on Chrome. - Embed PDF as a child frame instead of navigating to its extension WebUI. Keep the original URL (pointing to the file) to extend functionality of PDF viewer with URL parameters. - Make RenderWidgetHostInputEventRouter to work and modify most of the event forwarding logic to use that. This way WebEngine supports pages with multiple RenderWidgetHost and guest views can be interactive with user input. [ChangeLog] PDF files are opened as embedded objects, WebEngine will not navigate the content away from the requested file to present it. PDF viewer can accept URL parameters (e.g. to control zooming or fitting to view). Also, PDF viewer is interactive when displayed in a subframe. Task-number: QTBUG-80463 Task-number: QTBUG-86152 Task-number: QTBUG-90712 Change-Id: Ib1591fbd9a594891cdeace8e9dae0d3cc21a9f8e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devAllan Sandfeld Jensen2021-02-171-5/+26
|\| | | | | | | Change-Id: Idee0142b0e33fdf8ca663f1ef1bcd8b932985043
| * Fix loadFinished signal if page has content but server sends HTTP errorPeter Varga2021-02-051-4/+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>
| * Enable chrome://user-actions WebUIPeter Varga2021-02-041-1/+21
| | | | | | | | | | | | | | | | Also record some actions in WebContentsAdapter. The list is far from complete but these seemed obvious. Change-Id: I7dcddeef416efd6fb26618381a83d2b132b98d83 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devAllan Sandfeld Jensen2021-01-251-49/+40
|\| | | | | | | | | | | Including update to 87-based Change-Id: I36b6054e00de97ab055d0bc800cff08d0408fac6
| * Register PerformanceNode early enoughAllan Sandfeld Jensen2021-01-151-9/+0
| | | | | | | | | | | | | | Must be created before RenderFrame. Change-Id: I4ee121f6ad6a77fc48d12bc56b1fdb82ec97139b Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
| * Adaptations for Chromium 87Allan Sandfeld Jensen2021-01-131-18/+18
| | | | | | | | | | Change-Id: Ic4ffd98e02f986dbaf986405360e727c813e696e Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
| * Adaptations for Chromium 86Allan Sandfeld Jensen2021-01-131-12/+10
| | | | | | | | | | Change-Id: I7e0ebecdbb68cfff0b574c966f3fa80d28680e1c Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
| * Adaptations for Chromium 85Allan Sandfeld Jensen2021-01-131-15/+12
| | | | | | | | | | Change-Id: I33c1af7c431055d95e0fb540246765cce684de15 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
| * Adaptations for Chromium 84Allan Sandfeld Jensen2021-01-131-4/+9
| | | | | | | | | | Change-Id: I359805d0bea84147fca6de2e2c7b17b4dcb17bc7 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* | Merge branch '5.15' into devAllan Sandfeld Jensen2021-01-191-7/+11
|\| | | | | | | | | | | Last commits before 87 update. Change-Id: Id156b0199a8fd354c946cfe604ae8541ba554658
| * Migrate render_view_observer_qt to mojoMichal Klocek2020-12-111-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | Since mojo interface no longer works on render view, but on render frame rename the class to be WebEnginePageHost and WebEnginePageRenderFrame Keep SetBackgroundColor render message, since it is required to things work. Change-Id: I4d6b70dd448926f8ac2d75d2b87f3d490a4cfefb Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devAllan Sandfeld Jensen2020-09-141-15/+24
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-6/+7
| | | | | | | | | | Change-Id: I63ed851426b18623d549ceaf87f1b6eeec527966 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
| * Chromium 81-based adaptationsAllan Sandfeld Jensen2020-09-091-9/+17
| | | | | | | | | | Change-Id: Ie422b327025da084bc8038c7a0aadee2db801f29 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* | Reuse qwebenginesettings from core in qmlMichal Klocek2020-09-111-10/+9
| | | | | | | | | | | | | | | | | | | | Drop duplicated enums. Use qwebenginesettings as private for qquickwebenginesettings. This can most likely be more optimized when profile is moved to core. Change-Id: I04bdc6c5a35556bf6d38a273cefeeee9d2a0a310 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Remove obsolete, deprecated api from qwebenginedownloaditemMichal Klocek2020-08-181-1/+0
| | | | | | | | | | | | | | | | | | | | This patch removes: * path() * type() * DownloadType enum Change-Id: I3e29f9e8ce9e39b015c57cb7005e0290d1496291 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* | Fix almost all deprecation warningsJüri Valdmann2020-08-131-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace QString::fromUtf16({const ushort * -> const char16_t}) QMap::{unite -> insert} Q{Hover,DragEnter,DragMove,Drop}Event::{posF() -> position()} Q{Hover,DragEnter,DragMove,Drop}Event::{pos() -> position().toPoint()} Q{DragEnter,Drop}Event::{mouseButtons -> buttons} Q{DragEnter,Drop}Event::{keyboardModifiers -> modifiers} QMouseEvent::{localPos -> position} QMouseEvent::{windowPos -> scenePosition} QMouseEvent::{screenPos -> globalPosition} These should all be just renames without any change in behavior (save for some floating point conversions). The one remaining issue concerns the deprecation of binary JSON in qtbase, which is recommended to be replaced with CBOR. Change-Id: I8f3b533242fe9a58c08c2b09ff5d0bdbbfa6dd17 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Use QList instead of QVectorJarek Kobus2020-07-151-2/+2
| | | | | | | | | | | | Task-number: QTBUG-84469 Change-Id: I666a060351f73783e15e3f96884c9393a5cd7e46 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Refactor RenderWidgetHostViewQtPeter Varga2020-06-171-0/+1
|/ | | | | | | | Make RenderWidgetHostViewQtDelegateClient class instantiable and remove its implementation from RenderWidgetHostViewQt. Change-Id: Idcad3a805defe8b910f418b91f14808b6dbf083b Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* Add support for clearing the feature requestAllan Sandfeld Jensen2020-05-201-3/+3
| | | | | | Task-number: QTBUG-83476 Change-Id: I63ad9801e3e97f7fdac959600c69c04d0105be1f Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
* Allow to set feature permission before first ever navigationKirill Burtsev2020-05-141-1/+1
| | | | | | | | | | | | | | | | Since PermissionManagerQt functions independent of webcontents initialization, permission installment may be done earlier (right after page base constructor). Practically, this allows to grant/deny permission before first ever navigation to avoid permission feature request from well-behaving web application. Unfortunately, this only applies to Web Notifications: there is a way to check without request: Notification.permission javascript static object. Other supported features lack similar mechanism: they operate through success/failure callbacks, which unconditionally invoke permission requests, and Page/View API doesn't automatically answer with remembered permissions. Task-number: QTBUG-83476 Change-Id: I63a3cbca25498d5026975073e125f2ab4f9ab2ad Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Revive Pointer Lock featureSzabolcs David2020-05-041-3/+23
| | | | | | | | | | | | | | | 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>
* Fix -no-accessibility buildPeter Varga2020-04-291-2/+2
| | | | | | | | | | | | WebEngine is built without -DQT_NO_ACCESSIBILITY. qtgui-config.h defines it but accessibility_activation_observer.h didn't include it if accessibility was disabled. Also replace all occurrences of QT_NO_ACCESSIBILITY by QT_CONFIG(accessibility) in core. Change-Id: I5e5e14885e04cd542ec9e52d770f7070e8edbf8b Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Move request interceptor to ui threadMichal Klocek2020-04-201-0/+10
| | | | | | | | | | | | | We use now network service avoid io-ui-io-ui hops, pipe proxying url loader factory directly to ui thread. This solves thread safty issues. Add deprecated request interceptor test cases. Task-number: QTBUG-83082 Task-number: QTBUG-82999 Change-Id: I38778cf1a70789c5e92e04c93d1c93e2cc4c765a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Join some features request and response functionsAllan Sandfeld Jensen2020-04-151-8/+2
| | | | | | | 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-9/+9
| | | | | Change-Id: Icaf68648cbc2c13a61fc3b208ff1e64ca36c90b6 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* Speculative fix for titleUpdate test caseMichal Klocek2020-04-021-0/+10
| | | | | | | | | | | | | | | | | | | | | | After tedious investigation the issue boils down to error prone synchronization of web engine settings. WebEngineSettings are synchronized between the browser process and the render process. Moreover in the browser process the sync message is send to the render with QTimer::singleShot, which can cause race conditions if for example QWebPage::setUrl was used meanwhile. This makes current settings not being picked up by the render process and results in 'titleUpdate' test case flaky. This happens due to the fact that ShouldDisplayErrorPageForFailedLoad in the render process frame view could have invalid value. Try to sync web engine settings on every adapter load, setContent or reload. Mark some flaky settings in tests. Fixes: QTBUG-83078 Change-Id: I5289472f146e104d5cb6c3b9b20b26d3dc42f4b1 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Merge remote-tracking branch 'origin/5.14' into 5.15Allan Sandfeld Jensen2020-03-031-1/+4
|\ | | | | | | | | | | | | Conflicts: tests/auto/quick/qquickwebengineview/BLACKLIST Change-Id: I365daa73d2eb422ac916c32b86c5ad0d3c32086d
| * Invalidate accessible interfaces on destruction of view or pagePeter Varga2020-02-271-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Adaptations for Chromium 79Allan Sandfeld Jensen2020-02-281-9/+8
| | | | | | | | | | | | | | | | Fixes: QTBUG-80737 Fixes: QTBUG-81556 Fixes: QTBUG-81614 Change-Id: Ie6a69cdbf46d0508bff226f1b8fed28a618e1949 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Adaptations for Chromium 78Allan Sandfeld Jensen2020-02-281-2/+2
| | | | | | | | | | | | | | | | | | | | Including removal of renderer service. [ChangeLog][QWebEngineSetting] XSS Auditing has been removed, and XSSAuditingEnabled no longer has any effect. Change-Id: I0835e2a76551057f3eea30a343e0373b642192f0 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Allan Sandfeld Jensen2020-02-271-14/+32
|\| | | | | | | | | | | | | | | Conflicts: src/core/renderer_host/web_channel_ipc_transport_host.cpp tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp Change-Id: I47f2b893bc9f27cd9df641f76badc9e53b482ad4
| * Clear previous page text selection on new navigation unconditionallyKirill Burtsev2020-02-261-14/+32
| | | | | | | | | | | | | | | | | | | | Remove code duplication on triggering new url load, and use direct code to clear SelectedText instead of CollapseSelection as it assumes focused frame and might be ignored. Fixes: QTBUG-81574 Change-Id: I01cf02967e118f407c8a3997e176d5b258478a5a Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* | Add getter/signal to get the render process PIDFlorian Bruhin2020-02-011-0/+11
|/ | | | | | | | | | | | 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>
* Rework url changed logicMichal Klocek2020-01-141-4/+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>
* Store favicon URL when serializing QWebEngineHistoryDmitriy Kuminov2019-11-081-6/+20
| | | | | | | | | | | | | | This is to make QWebEngineHistoryItem::iconUrl of the deserialized QWebEngineHistory object return the same URL it had when serializing. Otherwise it's impossible to have favicons for URLs from the navigation history of a restored browser session until these URLs are visited again (so that Chromium refetches their favicons). These icons are usually needed much earlier - e.g. when showing a popup with the navigation history and having an icon URL allows to load it from a disk cache before visiting the page. Fixes: QTBUG-78998 Change-Id: Ief2d089d52f301826e5c131d401cafd08952a8b5 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Merge branch '5.13' into 5.14Allan Sandfeld Jensen2019-10-301-2/+1
|\ | | | | | | Change-Id: I6ab2e949cb2fa3b2db55a1654d42667db6257eab
| * Don't modify the allowed actions as they are correct alreadyAndy Shaw2019-10-111-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | By not modifying the allowed actions instead of just setting it to be the MoveAction will enable dragging from a webpage to another webpage to work correctly. Otherwise it will potentially reject the drag because it is seen only as a move, whereas it wouldn't be possible to really move from one webpage to another as the original source cannot be deleted. Change-Id: I34105d10e7d1dc831016c33c9c6cfc544c4e084b Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* | Adaptations for Chromium 77Allan Sandfeld Jensen2019-10-111-0/+1
| | | | | | | | | | | | Fixes: QTBUG-77267 Change-Id: I181e24cf80ebee6991b95dde6c636f0d169b40a4 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* | Refactor findText handlingPeter Varga2019-08-221-44/+6
| | | | | | | | | | | | | | | | | | | | | | 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>
* | WebContentsAdapter: don't use toStrongRef().data()Marc Mutz2019-08-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's an anti-pattern. Even though we don't expect other threads to destroy the last QSP while we use the pointer obtained from QWeakPointer, play it safe and use QWeakPointer idiomatically: as a non-owning reference, to be converted to an owning one for the duration of our use of the payload object. Amends 7cade5688f6a0bde067dc496cedcb8de14662116. Change-Id: Ib1c136569c27f413a4a78bfc35784032c53522a9 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* | Use QWeakPointer::toStrongRef().data() to get the raw pointerMichael Brüning2019-08-141-1/+1
| | | | | | | | | | | | | | | | Fixes a deprecation warning because QWeakPointer::data is deprecated from 5.14 onwards. Change-Id: I09b356b172cb9ffef880d6b97b4c6a9646203942 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into devAllan Sandfeld Jensen2019-07-241-3/+9
|\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/3rdparty src/core/core_chromium.pri tests/auto/quick/qmltests/BLACKLIST tests/auto/quick/qquickwebengineview/BLACKLIST tests/auto/widgets/qwebenginepage/BLACKLIST tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp tests/auto/widgets/qwebengineview/BLACKLIST Change-Id: I11b26f5eebde29c4c62247b90e11e3ae40789fe4
| * Merge remote-tracking branch 'origin/5.12' into 5.13Allan Sandfeld Jensen2019-07-231-3/+9
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/core/config/common.pri src/core/configure.json src/core/net/url_request_qrc_job_qt.cpp src/core/ozone/surface_factory_qt.cpp src/core/web_contents_adapter.cpp Change-Id: If679aa179123f793639da3d8ee4ab5d116707754
| | * Fix use-after-free in WebContentsAdapter::loadJüri Valdmann2019-07-181-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | Pass WebContentsAdapter pointer to lambda via QWeakPointer in case the adapter has been deleted already. Fixes: QTBUG-76958 Change-Id: I1962ba3dd1794a27e7013a2ad1b729fe7a08c079 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| | * Reset findText reply id on StopFinding to prevent callback laterKirill Burtsev2019-07-161-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Not updating lastReceivedFindReply caused next findText call after StopFinding to trigger redundant callback call on checking stale query. Fixes: QTBUG-77029 Change-Id: Iad4b71364ecb3ec3db3096b739e77620d12731f9 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* | | Adaptations for Chromium 75Allan Sandfeld Jensen2019-07-101-11/+38
| | | | | | | | | | | | | | | Change-Id: Idad08244e0c749a9f70f5eb9f8cd236039b941b3 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>