summaryrefslogtreecommitdiffstats
path: root/src/core/renderer
Commit message (Collapse)AuthorAgeFilesLines
* Allow XMLHttpRequests from qrc to fileJüri Valdmann2018-10-181-0/+7
| | | | | | | | | | | | | | | Add test for cross origin XMLHttpRequests from/to custom schemes. By default, this is not allowed, but can be changed by adding an origin access whitelist entry to blink::WebSecurityPolicy in the renderer. Do this for the qrc scheme. As a result SecurityOrigin("qrc").CanRequest("file") will return true, which makes DocumentThreadableLoader::Start disable CORS for the request. Otherwise, CORS would be used, which only works with CORS enabled schemes. Fixes: QTBUG-70228 Change-Id: I2da60fddbbfb490c6d2f03329be286dbc28e1f12 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* General adaptations for Chromium 69Allan Sandfeld Jensen2018-09-221-34/+64
| | | | | Change-Id: Ifeaf0ee13213dc5a24d2f2b4655cf7f405cddef7 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Adaptations for Chromium 68Allan Sandfeld Jensen2018-09-224-11/+8
| | | | | | Together-with: Tamas Zakor<ztamas@inf.u-szeged.hu> Change-Id: I805246b6f01cb151fff48588744408c676d87c14 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Make WebChannel an optional featureMichal Klocek2018-08-091-0/+4
| | | | | | | Add webengine-webchannel feature. Change-Id: I600572180f8169aafe79cf0408527cc087d9a007 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* Add printRequest()Michal Klocek2018-08-091-2/+2
| | | | | | | | | | | | | Adds printRequested() signal for web content. This signal is emitted on javascript window.print(). This change updates also qt printview manager implementation, fixes a corner case and warnings about ipc unconsumed attachments. Task-number: QTBUG-69237 Task-number: QTBUG-53745 Change-Id: I0c47b732e27e929ac6db237fb562b7d5f9b959c2 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Add DNS prefetchingAllan Sandfeld Jensen2018-08-012-0/+14
| | | | | | | | | | | 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>
* Migrate WebChannel IPC to mojoMichal Klocek2018-07-192-29/+52
| | | | | | | | | | | | | | Mojoifies: * WebChannelIPCTransport_SetWorldId * WebChannelIPCTransport_Message * WebChannelIPCTransportHost_SendMessage This change is just the simple rewrite of IPC in web channel transport, however ultimate goal here is to use mojo directly in javascript land. Change-Id: Ifcf84659b1d48d99cc4e87849b8a258303e8fedc Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Migrate from BUILDFLAG to QT_CONFIGMichal Klocek2018-07-024-18/+16
| | | | | | | | | | | 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>
* Adaptations for Chromium 67Allan Sandfeld Jensen2018-06-269-162/+152
| | | | | Change-Id: I13cedba56012f74651a044d6fa8f0957487bf3eb Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Adaptations for Chromium 66Allan Sandfeld Jensen2018-06-262-11/+71
| | | | | Change-Id: Iee88721a50036d4ef85a23dd1708d4fb84218708 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Use range-based for instead of Q_FOREACHJüri Valdmann2018-06-061-3/+3
| | | | | Change-Id: Ibf016b795ff98fddfa29fb5dc63924a2d2159d71 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Don't try to run user scripts if provisional load failedJüri Valdmann2018-06-051-9/+11
| | | | | | | | | Fixes DCHECK in UserResourceController::DidFinishDocumentLoad. Task-number: QTBUG-68594 Change-Id: I67128e2144420e61f8bffe080fa16a828b8202ad Reviewed-by: Szabolcs David <davidsz@inf.u-szeged.hu> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Merge remote-tracking branch 'origin/5.11' into devAllan Sandfeld Jensen2018-05-182-17/+30
|\ | | | | | | Change-Id: Id171407c17533846e8efe0e586d6793a61543438
| * Replace invalid characters in WebChannel messagesJüri Valdmann2018-05-161-15/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Turns out JavaScript's JSON.stringify is not guaranteed to produce valid UTF-16 strings. It is possible in JavaScript to produce string objects which contain invalid code units (unmatched surrogate pairs) and JSON.stringify will simply copy this data to it's output. However, such a string cannot be losslessly converted to UTF-8 and this leads to fun errors in WebChannelIPCTransport. This patch - Adds a test for the scenario above. - Changes WebChannelIPCTransport to replace these invalid code units with the Unicode replacement character U+FFFD. - Changes WebChannelIPCTransportHost to validate the data it gets from the renderer. Not validating the data defeats the whole point of Chromium's fancy multi-process architecture: the renderer is not to be trusted. - Changes WebChannelIPCTransport to throw JavaScript exceptions for various errors (missing argument, wrong type, invalid JSON). Seems like the polite thing to do. Task-number: QTBUG-61969 Change-Id: I83275a0eaed77109dc458b80e27217108dde9f7b Reviewed-by: Michal Klocek <michal.klocek@qt.io>
| * Fix handling of bad @match directivesSzabolcs David2018-04-271-2/+7
| | | | | | | | | | | | | | | | | | User scripts with parse errors in their @match patterns were included on all pages. Don't allow to fallback to "@include *" in this case. Task-number: QTBUG-67726 Change-Id: I8172184e79fe3e515f391bc6cc8274a624e67a19 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Run scripts from DidClearWindowObjectJüri Valdmann2018-05-164-57/+59
|/ | | | | | | Task-number: QTBUG-66011 Task-number: QTBUG-67453 Change-Id: I5feac1cdc74132718ba7a67b4653fcc6788da9e1 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Use cookie-access rights for webcontent settingsAllan Sandfeld Jensen2018-04-053-0/+317
| | | | | | | | | | This ties the indexed-db, DOM storage and filesystem access to cookie rights as they can all do the same cookies. A previous patch did the same for workers, but we were missing this class to complete the logic. Change-Id: I5ea894b6c631bcf25439759174866d260b91b71a Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* Make WebChannelIPCTransport into a RenderFrameObserverJüri Valdmann2018-03-223-147/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As of version 63, Chromium creates proxy frames also for the main frame in the frame tree during cross-process navigations. This leads to a segmentation fault in WebChannelIPCTransport because we assume that all main frames are local. See https://crrev.com/27caae83cb530daaf49f9a38793e427cdf493a65 for details. This patch refactors the renderer-side WebChannelIPCTransport from a RenderViewObserver into a RenderFrameObserver, which prevents the segmentation fault since the RenderFrameObserver is not created for proxy frames. Most likely this would have to be done eventually anyway since the RenderView and RenderViewObserver classes are deprecated and will likely be removed as part of the Site Isolation project. Installation is changed to follow Chromium's RenderFrameImpl in the sense of performing the installation from RenderFrameObserver::DidClearWindowObject instead of ContentRendererClient::RunScriptsAtDocumentStart. This has the benefit of avoiding the ScriptForbiddenScope DCHECK. Additionally there are the following minor changes: - The deprecated parameterless version of v8::Value::ToObject() method is replaced with v8::Value::IsObject() check and v8::Local::Cast. - The deprecated v8::Handle typedef is replaced with v8::Local. - The deprecated single-parameter WebContentsObserver::OnMessageReceived is replaced with the new two-parameter version. - blink::MainThreadIsolate() is used instead of v8::Isolate::GetCurrent() for Install/Uninstall since we know we are executing on the main thread. - WebChannelIPCTransportHost is changed to ignore messages from unexpected renderers in case something goes wrong with the renderers. - Logging is added to WebChannelIPCTransportHost for debugging purposes. Some new unit tests are added, all of which fail with the old version. Task-number: QTBUG-66333 Change-Id: I936d142fb042d9f936a3f9d08d4328ecba595f1f Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Fixup after adaptionsAllan Sandfeld Jensen2018-03-221-1/+1
| | | | | | | | | The last argument was removed, we are now calling a different deprecated version of the ExecuteScriptInIsolatedWorld. Change-Id: Ie3d351bfdef7ae490cc94362facc12ae96144a34 Reviewed-by: Michal Klocek <michal.klocek@qt.io> Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Remove some unused header includes from corePeter Varga2018-03-211-2/+0
| | | | | Change-Id: Ie5bcf9cfb249f364dbe01a8bee98aada2acdd38f Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Basic adaptations for 65-basedAllan Sandfeld Jensen2018-03-152-11/+11
| | | | | Change-Id: I121b14d6a44e80f5eea4b159c58f7010d472926e Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Basic adaptations for 64-basedAllan Sandfeld Jensen2018-03-153-41/+65
| | | | | Change-Id: I11e2da206e4e59872a38c178f57a5879c1bbf229 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Support regex format include rules in user scriptsPaul Clark2018-01-261-2/+26
| | | | | | | | | | | | | | | | | | | | | | | | | For user scripts with `@include` and `@exclude` directives in their headers, if the value starts and ends with `/` then assume it is a regular expression to be matched against a URL. This feature has been in the original greasemonkey module since 2011 and currently in webengine regex include rules are being blindly passed to the glob matcher. An alternative to this approach of leaving the bracketing slashes on the values as a kind of in-band signalling (and making the glob escaping conditional) would be to add new members to the UserScriptData struct for holding regex patterns. This commit also applies cleanly to v5.8 and every release after it. [ChangeLog][][UserScript] User script metadata parsing now supports regular expressions in @include and @exclude rules. Task-number: QTBUG-65484 Change-Id: Ie2e483419f6784f995131ffb7d2d5e91c2c55b1d Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io> Reviewed-by: Szabolcs David <davidsz@inf.u-szeged.hu> Reviewed-by: Florian Bruhin <qt-project.org@the-compiler.org> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Adaptations for Chromium 62Allan Sandfeld Jensen2018-01-254-18/+32
| | | | | Change-Id: I49cd3c419d4dd1180144c3c07bdd9a628ab73caa Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* Merge remote-tracking branch 'origin/5.10' into devAllan Sandfeld Jensen2018-01-171-8/+17
|\ | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/webengine/api/qquickwebengineview_p_p.h src/webenginewidgets/api/qwebenginepage_p.h tests/auto/quick/qmltests/data/TestWebEngineView.qml Change-Id: Id2acc92e8d0364bdaaf5a63ea2d2cb9cd533ade3
| * Merge remote-tracking branch 'origin/5.9' into 5.10Allan Sandfeld Jensen2018-01-081-8/+17
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/core/api/qwebengineurlrequestjob.cpp src/core/browser_context_adapter.cpp src/core/renderer/user_resource_controller.cpp src/core/web_engine_context.cpp src/webenginewidgets/api/qwebenginepage.cpp Change-Id: I5278e5e22e1776d42975fc94d70ff8ca4f81fb9a
| | * Check for null renderViewAllan Sandfeld Jensen2017-12-111-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It can according to documentation potentially be null, even if it might not happen in our cases. Task-number: QTBUG-63854 Change-Id: I76029c83fe32c163c2707568fe81b7590a79b4fe Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Michael Brüning <michael.bruning@qt.io> Reviewed-by: Viktor Engelmann <viktor.engelmann@qt.io>
* | | Merge remote-tracking branch 'origin/5.10' into devAllan Sandfeld Jensen2017-11-292-6/+6
|\| | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/core/web_event_factory.cpp src/core/web_event_factory.h src/webengine/render_widget_host_view_qt_delegate_quick.h Change-Id: Ic43787e2689c81b501ed395a990190eb67d83a2b
| * | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-11-151-1/+1
| |\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/3rdparty tests/auto/quick/qmltests/qmltests.pro tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp Change-Id: I2a1e3a83e29a1d6709f3e98fda3f7b4ab7ab297e
| | * Fix invalid Q_ASSERT in WebChannelIPCTransportJüri Valdmann2017-11-101-1/+1
| | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-64419 Change-Id: I094cfc654498c74f4d6b656ec5647a90700a4f6a Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| * | Fix widevine with proprietary codecsAllan Sandfeld Jensen2017-11-121-5/+5
| | | | | | | | | | | | | | | | | | | | | Switched from define to buildflag. Change-Id: I01b3e0aad7f54af1a485733e7d4ec25a31d14015 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | | Merge remote-tracking branch 'origin/5.10' into devAllan Sandfeld Jensen2017-10-271-4/+4
|\| | | | | | | | | | | Change-Id: Ibc1c881a67bf088ba6fb044e2553c74c7e9e24ca
| * | Adaptations to 61-basedAllan Sandfeld Jensen2017-10-251-4/+4
| | | | | | | | | | | | | | | Change-Id: I5cb198445f283c6cea8187a1a2883896df0ee918 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* | | Merge branch '5.10' into devAllan Sandfeld Jensen2017-10-137-27/+33
|\| | | | | | | | | | | Change-Id: I3a411e4019a5ec2f7d1a967b62a00ad7cf92f6f4
| * | Merge remote-tracking branch 'origin/5.9' into 5.10Allan Sandfeld Jensen2017-09-297-27/+33
| |\| | | | | | | | | | Change-Id: I7094e85a7770303a2ae30baccbc484c04f33600e
| | * Add LICENSE.ChromiumKai Koehne2017-09-207-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | The mentioned LICENSE file is not available; add it under the name LICENSE.Chromium. Task-number: QTBUG-60006 Change-Id: Ib2b3cb64467046c7ba1f53b0bbe14c3ec5a5291d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| | * Fix license headers for libraries and pluginsKai Koehne2017-09-202-20/+26
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-60006 Change-Id: Ibc0507f300f52154e6f131056d826a4dcef009c2 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | | Replace Q_DECL_OVERRIDE with overrideKevin Funk2017-09-211-1/+1
|/ / | | | | | | | | Change-Id: I5fb337a83bfc98c23b2f3cd51839feb40fad010e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Fix memory leak of UserResourceController::RenderFrameObserverHelperAllan Sandfeld Jensen2017-09-161-8/+15
| | | | | | | | | | | | | | | | Use weak pointers to make sure pending calls don't can run after it has been deleted. Change-Id: I6e808794e1d977dd9e236cf4a3a9ab4213ed7efd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Adaptations for Chromium 60Alexandru Croitor2017-09-119-41/+114
| | | | | | | | | | | | 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-115-38/+37
| | | | | | | | | | Change-Id: I472053e316bfa782d0a6fb8903f4901be12247ae Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Do not send empty WebChannelIPCTransportHost_SendMessageStephan Reiter2017-07-191-4/+9
| | | | | | | | | | | | Task-number: QTBUG-61969 Change-Id: I3367889041614a5e7489909dd38c8af638edf17c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Simple adaptations for Chromium 58Allan Sandfeld Jensen2017-06-141-2/+2
| | | | | | | | | | Change-Id: I7c2c85973b03fdbd2eafb5339f33a3758d53e924 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* | Adaptations for Chromium 57Allan Sandfeld Jensen2017-06-145-12/+8
|/ | | | | Change-Id: Ia2756c1e9b13839c2330bd98cf953d47cbdac0dd Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* Standardize override declarationAllan Sandfeld Jensen2017-04-215-26/+27
| | | | | | | | Update our overrides to Qt coding standard getting rid of Q_DECL_OVERRIDE and redundant virtual declarations. Change-Id: Id8b0750eb05c51fc8f50cac4000a811eebcbf918 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix pepper cdms featureAllan Sandfeld Jensen2017-04-061-4/+4
| | | | | | | Is now also buildflag and not command line define. Change-Id: I3c687981928239f669bd285797b5ceee4e994822 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Fix spellcheck feature checkAllan Sandfeld Jensen2017-04-042-5/+6
| | | | | | | | | Was changed to generated buildflag headers instead of command line defines. Task-number: QTBUG-59687 Change-Id: Iead64f5321d000c07172ee27a0032394527ec501 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Adaptations for Chromium 56Allan Sandfeld Jensen2017-03-273-15/+18
| | | | | Change-Id: I78240d7956de4716757761fc6517f031b4adb822 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Simple adaptations to Chromium 55Allan Sandfeld Jensen2017-03-012-8/+11
| | | | | | | The simplest adaptations to API and build changes in Chromium 55 Change-Id: I923fa188690a04902492317807f72f006bcab9c6 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Provisional Fix for Navigation-Breakage on right-click in Flash appletViktor Engelmann2017-02-021-1/+9
| | | | | | | | | | | | | | | When one right-clicks into a flash applet, chromium believes that a context menu was open (even though PepperRendererHostFactoryQt::CreateResourceHost returns NULL, which only causes an ASSERT on chromiums side). Because of this, the navigation is disabled, although no context menu is displayed. This fix just sends a message to chromium, telling it that "the context menu" is now "closed", which causes another ASSERT, but re-enables the navigation. Task-number: QTBUG-57924 Change-Id: Id6d8150a7d4944162bab81362153f8621d35bb4c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>