summaryrefslogtreecommitdiffstats
path: root/src/core/web_engine_settings.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add back prefers-color-scheme supportPeter Varga2021-01-261-17/+10
| | | | | | Task-number: QTBUG-89753 Change-Id: I89552671de0127d4e74ede4ca5f7fc4eab8cae6d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Adaptations for Chromium 87Allan Sandfeld Jensen2021-01-131-13/+13
| | | | | Change-Id: Ic4ffd98e02f986dbaf986405360e727c813e696e Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* Optimize WebEngineSettings::testAttributeAllan Sandfeld Jensen2020-10-061-8/+11
| | | | | | | Do not look up fallback values before they are needed. Change-Id: I8bb21e261e8d218c658ac2a08e3cdc30b2cea47d Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Delete old compositor and remove --disable-viz-display-compositorJüri Valdmann2020-09-091-6/+0
| | | | | | | Change-Id: I1b056a61e2b56b19441f559e97f785c87df61a0c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit b00af13974b2c72ae4d397fbdf5925181e7cc1bf) Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* Disable accelerated and offscreen canvas for old rendererJüri Valdmann2020-04-151-0/+6
| | | | | | | | | | | | | | Offscreen canvas requires surface embedding which is a viz-only feature. Accelerated canvas uses gpu memory buffers which don't work with old renderer. Updates src/3rdparty with dependent change * 757b9f45 Expose WebPreferences::disable_features_depending_on_viz Fixes: QTBUG-56147 Change-Id: I90322f05554af43de5db9e386929d4faf5e65b6d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Adaptations for Chromium 80Allan Sandfeld Jensen2020-04-071-12/+17
| | | | | Change-Id: Icaf68648cbc2c13a61fc3b208ff1e64ca36c90b6 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* Speculative fix for titleUpdate test caseMichal Klocek2020-04-021-0/+2
| | | | | | | | | | | | | | | | | | | | | | 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>
* Adaptations for Chromium 79Allan Sandfeld Jensen2020-02-281-12/+5
| | | | | | | | 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/+1
| | | | | | | | | | 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>
* Follow theme settings like Chrome doesAllan Sandfeld Jensen2019-10-211-0/+46
| | | | | | | | | Set Blink-settings based on Chromium theme settings to match Chrome defaults. Change-Id: I02975c319644583166ed3c5a0eae02975d7b14f1 Fixes: QTBUG-79347 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* Adaptations for Chromium 74Allan Sandfeld Jensen2019-07-101-3/+3
| | | | | Change-Id: Icdefa05eec39c632328dfc40862e5b734170bf3f Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* Claim to support hoverFlorian Bruhin2019-05-231-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Chromium sets those settings based on ui::GetAvailableHoverTypes() and GetPrimaryHoverType() which (on Linux) use an InputDeviceManager to check whether there's a mouse or touchpad present. With them being unset, CSS media queries (hover/any-hover) tell websites that hovering isn't supported: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/hover https://developer.mozilla.org/en-US/docs/Web/CSS/@media/any-hover On some websites such as GitHub, this disables/breaks hovering functionality. QtWebEngine can't figure out whether it's running on a device with a mouse/touchpad (using Chromium's code won't work as no InputDeviceManager is available, and Qt doesn't seem to have any comparable functionality). However, since QtWebEngine is not available for mobile platforms, assuming that a mouse is present (rather than assuming that none is) seems reasonable. Change-Id: Ie038318f105bafdf955d512ab10f13f33da1111b Fixes: QTBUG-75894 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* Fix capitalisation of letters for PDF viewer settingMichael Brüning2019-03-191-2/+2
| | | | | | | | PDFViewerEnabled is renamed to PdfViewerEnabled. Task-number: QTBUG-74543 Change-Id: I48a242a52ab0689b06815ac3cbd98c44902cc358 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Merge remote-tracking branch 'origin/5.12' into 5.13Allan Sandfeld Jensen2019-03-041-26/+8
|\ | | | | | | Change-Id: I1dd136df7004b11e2f38a2ec4e82a6fa81627479
| * Fix crash on dynamic_cast in global event filterJüri Valdmann2019-02-251-26/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Installing an event filter on QApplication which uses dynamic_cast will crash the application since QtWebEngine is sending QTimerEvents to classes without RTTI information. Fix by 1. Moving the QObject part of MessagePumpForUIQt into api/ as a private class. 2. Using QTimer directly in WebEngineSettings, without subclassing. Fixes: QTBUG-73833 Change-Id: Ida73006a4fef76637c964f8f05468adcc4a190ce Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Add a setting to control if the PDF viewer is enabledMichael Brüning2019-02-221-0/+5
|/ | | | | | | | | | [ChangeLog] Introduces a setting to control if the internal PDF viewer is enabled. By default, PDF documents will now be opened in the viewer instead of being downloaded. Change-Id: I78b3b3702ae3be3da58c9635720ba861db3de661 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Add DNS prefetchingAllan Sandfeld Jensen2018-08-011-0/+2
| | | | | | | | | | | Turns out we did no have DNS prefetching. It requires an extra component. The same component can also do pre-connect, but we do not enable that, as it requires a predictive browsing backend. [ChangeLog][Settings] DnsPrefetchEnabled added, but disabled by default. Change-Id: Ieb036435b9f1a72a7be302e38e89e0c347c7176b Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* Enable XSS auditing by defaultFlorian Bruhin2018-07-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Chromium has XSS auditing enabled by default - it seems like a bad idea for QtWebEngine to disable a Chromium security feature by default. The Google design document for the XSS auditor also claims[1]: Processing costs are essentially zero unless the URL or POST body includes any of the four characters " > < '. When those characters are found, we only invoke heavy processing on those attributes that might be dangerous. This stands in contrast to the XSS Filter in Internet Explorer, which runs costly regular expressions. Thus, worries about performance issues are likely unsubstantiated. This can be tested using the first link on [2], where Chromium blocks loading by default but QtWebEngine did not. [1] https://www.chromium.org/developers/design-documents/xss-auditor [2] http://webdbg.com/test/xss/auditor.aspx [ChangeLog][QtWebEngine] The XSSAuditingEnabled setting is now enabled by default, to mirror Chromium's behavior. Change-Id: Id57177ec8183335bc94cc8c0c440ac1e10d2c74f Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Konstantin Tokarev <annulen@yandex.ru> Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Migrate from BUILDFLAG to QT_CONFIGMichal Klocek2018-07-021-1/+1
| | | | | | | | | | | During configuration we mapped qt webengine fetures to chromium ones and passed them to gn. We used BUILDFLAG to optionally compile code in core. Use QT_CONFIG directly for qt files and add config sanity checks to make sure requested features are present. Change-Id: I930df114ac9aec8e73139ea9135925fc3ad8e39c Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Use range-based for instead of Q_FOREACHJüri Valdmann2018-06-061-2/+2
| | | | | Change-Id: Ibf016b795ff98fddfa29fb5dc63924a2d2159d71 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Basic adaptations for 64-basedAllan Sandfeld Jensen2018-03-151-2/+2
| | | | | Change-Id: I11e2da206e4e59872a38c178f57a5879c1bbf229 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Merge remote-tracking branch 'origin/5.11' into devAllan Sandfeld Jensen2018-02-021-0/+2
|\ | | | | | | Change-Id: I454bb7216b013cc9aa9ee660893fe37034fd50e1
| * Expose JavascriptCanPaste attributeKai Koehne2018-02-021-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Expose an attribute to enable the execCommand("paste") functionality, which is by default disabled due to security concerns. [ChangeLog][General] Added JavaScriptCanPaste attribute that enables JavaScript 'execCommand("paste")'. Task-number: QTBUG-64056 Change-Id: I1a414021e020473dd15946fff91fb103d871e961 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Adaptations for Chromium 63Allan Sandfeld Jensen2018-01-251-2/+2
|/ | | | | Change-Id: I551c7091bbc0463bed94180313eb2bfe92f0ad84 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* Merge remote-tracking branch 'origin/5.10' into devAllan Sandfeld Jensen2017-12-181-2/+3
|\ | | | | | | Change-Id: I9ddd2bdd830a862cd81dc1af5616d43e652a1c0e
| * Merge remote-tracking branch 'origin/5.9' into 5.10Allan Sandfeld Jensen2017-12-051-2/+3
| |\ | | | | | | | | | Change-Id: Ia24d831c2d2b04d13cf6eef2883d2ab2e4cad642
| | * Fix viewport supportAllan Sandfeld Jensen2017-12-021-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Set the viewport related preferences together. Task-number: QTWB-2 Task-number: QTBUG-57206 Change-Id: Ib06bf0159d0e0d77d963f8fa3752b668e4795f8b Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* | | Expose an option to hide internal IP addresses from WebRTCAllan Sandfeld Jensen2017-11-291-2/+32
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-57505 Change-Id: I8d8f906311ce94b2d9df67cb4479b70c8961c3a6 Reviewed-by: Viktor Engelmann <viktor.engelmann@qt.io>
* | | Add setting to inhibit autoplay until user interactionAllan Sandfeld Jensen2017-11-021-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pass through the PlaybackRequiresUserGesture Chromium setting which Chrome enables by default on Android. Task-number: QTBUG-60799 Change-Id: I105fc7d558f9b67417a0047ecb1efe7677817ea4 Reviewed-by: Florian Bruhin <qt-project.org@the-compiler.org> Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-09-221-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/webengine/api/qquickwebenginesettings_p.h src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc Change-Id: I9cac7059557084a575af02782af886f55a8d404f
| * | Replace Setting HideScrollbars by ShowScrollBarsViktor Engelmann2017-09-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Positive options are more intuitive and make for a better API. Task-number: QTBUG-63179 Change-Id: I632ee768dba52554e7d37d9da84661a1d01f1f37 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* | | Add Setting to allow passing unknown URL schemes to QDesktopServicesViktor Engelmann2017-09-181-0/+18
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A new enum UnknownUrlSchemePolicy was added to WebEngineSettings, QWebEngineSettings and QQuickWebEngineSettings. WebContentsDelegate now has a new attribute of that type, which can be read and written through the public APIs Q(Quick)WebEngineSettings::unknownUrlSchemeNavigationPolicy and Q(Quick)WebEngineSettings::setUnknownUrlSchemeNavigationPolicy. This way, one can control, whether URLs with unknown schemes are passed to QDesktopServices. WebContentsAdapterClient::navigationRequested is called on these requests, so this allows more fine-grained control over the schemes and origins, that are allowed. Task-number: QTBUG-58627 Change-Id: Ie81d9503456d63ea1ed5606483254acf437cd8f7 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Adaptations for Chromium 60Alexandru Croitor2017-09-111-2/+5
| | | | | | | | | | | | Change-Id: I536258e22c2ec143f2fd3f1cbda229e0611b6af4 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | Adaptations for Chromium 59Allan Sandfeld Jensen2017-09-111-17/+1
| | | | | | | | | | Change-Id: I472053e316bfa782d0a6fb8903f4901be12247ae Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Make FocusOnNavigationEnabled setting disabled by defaultv5.10.0-alpha1Oleg Yadrov2017-09-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this setting was added in Qt 5.8, the behavior was that QWebEngineView/WebEngineView got the focus automatically. With the new setting added it is configurable, but it was left enabled for compatibility reasons. It would had to be changed at some point anyway: none of other QML items or widgets grab the focus after creation, so why would QWebEngineView/WebEngineView do? This patch also fixes a bug with the text cursor in WebView (the cursor was blinking as if WebView had the focus when it did not). [ChangeLog][Important Changes][QtWebEngine][General] focusOnNavigationEnabled setting which allows controlling whether a web view will receive focus on a navigation request is now disabled by default. Task-number: QTBUG-60152 Task-number: QTBUG-60149 Change-Id: I78dc9bb9ffc70bf06217952acd456b97651c5185 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devAllan Sandfeld Jensen2017-08-141-0/+25
|\| | | | | | | | | | | Includes sha1 bump of src/3rdparty to head of 58-based. Change-Id: I37743c3979c1b6fb21f71eab7048e82f7aa5d78b
| * Take into account the value of the --touch-events Chromium switchAlexandru Croitor2017-07-111-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Chromium 56 the --touch-events switch controls both the availability of the Touch Events API in JavaScript (presence of 'ontouchstart' in 'window' object), and whether touch events are dispatched at all. In Chromium 57, the switch controls only the Touch Events API availability, and touch events are always dispatched. In Qt 5.9.0 which is based on Chromium 56, we always dispatched touch events, ignored the value of --touch-events, and determined the availability of the Touch Events API by checking if QTouchDevice lists any touch screen devices (essentially Chromium's --touch-events=auto option). This commit changes the behavior of WebEngine to match that of Chromium 57, so that users can choose to enable or disable the Touch Events API via the --touch-events switch, whereas the default will be 'auto' mode. Touch events will always be dispatched as usual. Users that wish to stop dispatching touch events can install an event filter on WebEngine's view focus proxy. Task-number: QTBUG-61045 Change-Id: I07404af3336619869aa87a90a1b426036548dd55 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* | Add HideScrollbars settingPeter Varga2017-08-021-0/+2
| | | | | | | | | | | | | | [ChangeLog][Settings] Added setting to hide scrollbars. Change-Id: I17695bb54a460621358345d303302b93eb342696 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Don't disable local storage for offTheRecord profilesFlorian Bruhin2017-06-261-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Chromium has local storage enabled in icognito windows, and simply doesn't persist it to disk. QtWebEngine seems to do the same when local storage is enabled in an off-the-record profile, so there's no reason to disable it by default. This also matches the behavior in Chromium (and Firefox, but not Safari). [ChangeLog] HTML 5 local storage is now enabled by default (but residing in memory) in off-the-record profiles. Change-Id: I0cb7e946575a53471ffed9d3324b3ae4c2e80eee Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Adaptations for Chromium 57Allan Sandfeld Jensen2017-06-141-1/+1
| | | | | | | | | | Change-Id: Ia2756c1e9b13839c2330bd98cf953d47cbdac0dd Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* | Handle ViewHostMsg_Focus message from chromiumViktor Engelmann2017-05-241-0/+1
|/ | | | | | | | | | | | | | | | | | | | | | Calling the method window.focus() in javascript causes chromium to send a ViewHostMsg_Focus message, which is received by RenderViewHost, which then calls RenderViewHost::OnFocus. This calls WebContentsDelegate::ActivateContents, which does nothing in the default implementation. We now override this method in WebContentsDelegateQt::ActivateContents and call Focus() on the WebContents object IF the new WebEngineSettings value AllowWindowActivationFromJavaScript is true (by default, it is false). This in turn calls QWebEnginePagePrivate::focusContainer. The WebEnginePage now calls QWidget::activateWindow() in addition to QWidget::setFocus, to make sure the window is also activated (which it might not be, if multiple windows are open). For the QML side, a new boolean Property allowWindowActivationFromJavaScript was added. Task-number: QTBUG-58800 Change-Id: Iabf5d4d15236c77838a3886de81e9dafcaf49f5d Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Merge remote-tracking branch 'origin/5.8' into devAllan Sandfeld Jensen2017-01-181-0/+5
|\ | | | | | | Change-Id: If16bfc6f0fbfd0040e13a8a3cbaa113fda10f387
| * Enable viewport-meta setting againAllan Sandfeld Jensen2016-12-291-0/+5
| | | | | | | | | | | | | | | | | | | | We enabled this using a command-line argument in 5.6, but that argument is no longer available in 5.7, so instead set it to match viewport enabled. Task-number: QTBUG-57206 Change-Id: Ibef9e93bc96f74429870fdb340d6ea0c0030159c Reviewed-by: Jocelyn Turcotte (Woboq GmbH) <jturcotte@woboq.com>
* | Add AllowGeolocationOnInsecureOrigins settingAllan Sandfeld Jensen2016-12-011-0/+2
|/ | | | | | | | | | | This provides a way to restore earlier QtWebEngine behavior where geolocation was possible from all origins. [ChangeLog][Settings] Added setting to again allow insecure origins to request geolocation. Change-Id: I043fb7a36a56fa5acc1740d52a50b9d7ff49a2c5 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-10-061-0/+1
|\ | | | | | | | | | | | | | | Conflicts: src/3rdparty src/webengine/api/qquickwebenginesettings.cpp Change-Id: Ie4abadb076c51d070cbb05f29b9ebcd9705933ad
| * Disable local database when local storage is disabledAllan Sandfeld Jensen2016-09-251-0/+1
| | | | | | | | | | | | | | Ties the feature switch for Indexed DB to the same as local storage. Change-Id: I9ea8992cc00097a8f7bd86236f8cd43008566d2b Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into 5.8Allan Sandfeld Jensen2016-08-301-0/+4
|\| | | | | | | Change-Id: I82f7a6a6d1bf27dc8adf7e2a91ea8ab29c54a607
| * Support the command-line argument --allow-running-insecure-contentAllan Sandfeld Jensen2016-08-261-0/+4
| | | | | | | | | | | | | | | | | | Reads the chromium command-line argument and pass it on to WebKit. This also prepares for adding it as proper API later. Task-number: QTBUG-54902 Change-Id: I391940ef43a88332f45cc3c97fe22514d7f6a76c Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* | Add setting to enable printing of CSS backgroundsMichael Bruning2016-08-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | [ChangeLog][Printing] Printing will now include the CSS background of the printed elements by default. This restores the default behavior from Qt WebKit. It can be controlled via the PrintElementBackgrounds web setting. Task-number: QTBUG-54918 Change-Id: I37c37456dfec6368f22c36c515ac3cad1bbf8006 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Add focusOnNavigationEnabled settingAlexandru Croitor2016-08-091-0/+1
|/ | | | | | | | | | | | | | | | The focusOnNavigationEnabled setting allows changing the behavior of whether a WebEngine view (widget or quick) will automatically get focus, whenever a navigation action happens (load, reload, previous history entry, etc). The default behavior before this patch was to always grab the focus. [ChangeLog][QtWebEngine][General] Add focusOnNavigationEnabled setting which allows controlling whether a web view will receive focus on a navigation request. Previously the view always received the focus. Task-number: QTBUG-52999 Change-Id: I6d30d973a41b53011131f21dcecbf6ec4d652759 Reviewed-by: Kai Koehne <kai.koehne@qt.io>