summaryrefslogtreecommitdiffstats
path: root/src/core/web_engine_settings.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Remove WebAudio settingsAllan Sandfeld Jensen2016-05-021-2/+0
| | | | | | | | | In Chromium 51 WebAudio will be always on, and can not be runtime enabled or disabled. We should avoid introducing a setting we can not even support in the next version. Change-Id: I42f7d4f3f7f952f38361ef73dfe7b318ea1a4cf5 Reviewed-by: Michael Brüning <michael.bruning@theqtcompany.com>
* Add settings for FaviconManager's icon download modesPeter Varga2016-03-251-0/+2
| | | | | | Change-Id: I8e4b11089de29623ed39ec6b13fe30be734baa3e Task-number: QTBUG-51179 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Unify license header usage.Jani Heikkinen2016-02-011-11/+14
| | | | | | | | | Update files using old header.LGPL3 to use header.LGPL Update files using old header.FLD to use new header.FDL Update files using old header.BSD to use new header.BSD Change-Id: I36a67aaa8c3ca6c7946308defc9c03c3571a7d23 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Respect --enable-smooth-scrollingAllan Sandfeld Jensen2016-01-051-1/+2
| | | | | | | | Change the scroll animator default to follow the same flags as used in Chromium. Change-Id: Ic6a9d23950f2ac6a18bd9b4e58cbedf560943717 Reviewed-by: Michael Brüning <michael.bruning@theqtcompany.com>
* Add pictograph font family settingAllan Sandfeld Jensen2015-12-111-2/+2
| | | | | | | Use the same default font as Serif since that is what Chromium does. Change-Id: Ie83cf114b516c6a1ae0d78ab768c1713144074ac Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Fix default settings initializationAllan Sandfeld Jensen2015-12-091-63/+51
| | | | | | | | | | | | We must ensure WebContext is initialized before using global chromium objects like command_line. And clean-up the use of static default tables, both fixing their name, and fix a problem where the default depends on which type of profile was initialized first. Change-Id: Ibd8cbbf00bb2ad6cc1d823023d2a48e10bdf93bc Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Add WebGL, WebAudio and Accelerated2dCanvas settingsAllan Sandfeld Jensen2015-12-021-0/+16
| | | | | | | | | | | These settings were in QtWebKit and are easily added in QtWebEngine. Without the preferences the same could be achieved using command line flags. The defaults are calculated to match what is set in RenderViewHostImpl. Change-Id: I0c80507574ebc3898fc409e47194246fb00abc75 Reviewed-by: Michael Brüning <michael.bruning@theqtcompany.com>
* Merge branch '5.6' into devAllan Sandfeld Jensen2015-11-201-49/+71
|\ | | | | | | Change-Id: I05fe27b8321944cf68cc96dfa9dfcaeb54c8c8cd
| * Fix resetting attributes in top level WebEngineSettingsSzabolcs David2015-11-121-48/+70
| | | | | | | | | | | | | | | | | | | | | | Store default values in separate containers and remove related FIXMEs from WebEngineSettings. Add API test case in order to demonstrate the bug. Change-Id: If9d98265cab0f41b543fe690d534879b65f2b577 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | Add MediaCaptureEnabled setting to the web engine settings.Michael Bruning2015-11-161-0/+1
| | | | | | | | | | | | | | | | | | Defaults to off. Change-Id: I416116ce07c8b7f5b24ad6e329390358406eadca Task-number: QTBUG-48801 Reviewed-by: Szabolcs David <davidsz@inf.u-szeged.hu> Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* | Adapting to Chromium 47Allan Sandfeld Jensen2015-10-271-1/+0
|/ | | | | | | Updating to Chromium 47 and adapting API. Change-Id: Id465bbcd4facd7c47cb8a9f4bd4e18cbdc0d1120 Reviewed-by: Michael Brüning <michael.bruning@theqtcompany.com>
* Widgets: Add fullscreen supportSzabolcs David2015-08-261-2/+2
| | | | | | Change-Id: Ibf1697d2bb3b3af5e7d71149305c5acffba43f0f Reviewed-by: Szabolcs David <davidsz@inf.u-szeged.hu> Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>