From jp.kuraisu at gmail.com Wed Mar 2 12:34:34 2016 From: jp.kuraisu at gmail.com (Aleksey Yermakov) Date: Wed, 2 Mar 2016 14:34:34 +0300 Subject: [Qtwebengine] Debugging QtWebEngine in MSVC 2013 Message-ID: Hi, I'm trying to debug application cache related crash in QtWebEngine but MSVC2013 tells me there is no debug symbols for Chromium code. I can step into Qt code just fine, but Chromium code is unavailable. I'm not sure, but I think maybe chromium symbols are stripped from pdb. Is there a way to fix this? Manually reconfigure chromium build process perhaps? Thanks, Aleksey -- Aleksey Yermakov -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kai.Koehne at theqtcompany.com Wed Mar 2 12:52:41 2016 From: Kai.Koehne at theqtcompany.com (Koehne Kai) Date: Wed, 2 Mar 2016 11:52:41 +0000 Subject: [Qtwebengine] Debugging QtWebEngine in MSVC 2013 In-Reply-To: References: Message-ID: > -----Original Message----- > From: QtWebEngine [mailto:qtwebengine- > bounces+kai.koehne=theqtcompany.com at qt-project.org] On Behalf Of > Aleksey Yermakov > Sent: Wednesday, March 02, 2016 12:35 PM > To: qtwebengine at qt-project.org > Subject: [Qtwebengine] Debugging QtWebEngine in MSVC 2013 > > Hi, > > I'm trying to debug application cache related crash in QtWebEngine but > MSVC2013 tells me there is no debug symbols for Chromium code. > > I can step into Qt code just fine, but Chromium code is unavailable. I'm not > sure, but I think maybe chromium symbols are stripped from pdb. > > Is there a way to fix this? Manually reconfigure chromium build process > perhaps? We consciously disabled debugging symbols on MSVC 32 bit to avoid spurious Out Of Memory linker errors (commit 7fc3024a16af6e96b6391b0dc19d6b5887372d05). The best workaround is to build with MSVC 64 bit :) If you want to nevertheless try to build 32 bit with debugging symbols, you can revert the commit, or just comment out GYP_CONFIG += fastbuild=2 in src/core/config/windows.pri. Then delete .qmake.cache and configure again. Regards Kai PS: Task for this was https://bugreports.qt.io/browse/QTBUG-49545 From jp.kuraisu at gmail.com Wed Mar 2 13:09:30 2016 From: jp.kuraisu at gmail.com (Aleksey Yermakov) Date: Wed, 2 Mar 2016 15:09:30 +0300 Subject: [Qtwebengine] Debugging QtWebEngine in MSVC 2013 In-Reply-To: References: Message-ID: Hi Kai, Thanks for the fast reply! I'll try 64 bit build. Regards, Aleksey On Wed, Mar 2, 2016 at 2:52 PM, Koehne Kai wrote: > > > > -----Original Message----- > > From: QtWebEngine [mailto:qtwebengine- > > bounces+kai.koehne=theqtcompany.com at qt-project.org] On Behalf Of > > Aleksey Yermakov > > Sent: Wednesday, March 02, 2016 12:35 PM > > To: qtwebengine at qt-project.org > > Subject: [Qtwebengine] Debugging QtWebEngine in MSVC 2013 > > > > Hi, > > > > I'm trying to debug application cache related crash in QtWebEngine but > > MSVC2013 tells me there is no debug symbols for Chromium code. > > > > I can step into Qt code just fine, but Chromium code is unavailable. I'm > not > > sure, but I think maybe chromium symbols are stripped from pdb. > > > > Is there a way to fix this? Manually reconfigure chromium build process > > perhaps? > > We consciously disabled debugging symbols on MSVC 32 bit to avoid spurious > Out Of Memory linker errors (commit > 7fc3024a16af6e96b6391b0dc19d6b5887372d05). > > The best workaround is to build with MSVC 64 bit :) If you want to > nevertheless try to build 32 bit with debugging symbols, you can revert the > commit, or just comment out > > GYP_CONFIG += fastbuild=2 > > in src/core/config/windows.pri. Then delete .qmake.cache and configure > again. > > Regards > > Kai > > PS: Task for this was https://bugreports.qt.io/browse/QTBUG-49545 > > > -- Aleksey Yermakov -------------- next part -------------- An HTML attachment was scrubbed... URL: From knt261 at gmail.com Wed Mar 9 02:46:53 2016 From: knt261 at gmail.com (Kevin Truong) Date: Tue, 8 Mar 2016 17:46:53 -0800 Subject: [Qtwebengine] BUG: arguments to dbus_connection_dispatch() were incorrect Message-ID: Hi staff, I am using Qt WebEngine on a new machine. It didn't have problems with the previous machines, but on the new machine when I run a Qt WebEngine program, it outputs this error in the terminal: process 30346: arguments to dbus_connection_dispatch() were incorrect, assertion "connection != NULL" failed in file ../../dbus/dbus-connection.c line 4559. This is normally a bug in some application using the D-Bus library. The program still runs fine and everything is rendered correctly, although it seems much slower. I confirmed this is due to the QT code because when I comment out anything that uses QtApplication, this message stops being printed. I built Qt5 and Qt WebEngine via the github repo ( https://github.com/qtproject/qt5), and tried both versions 5.6 and 5.5. The machine I am using is ubuntu. uname -a: Linux test-render3 3.19.0-51-generic #57-Ubuntu SMP Fri Feb 19 14:05:05 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux lsb_release -a: No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 15.04 Release: 15.04 Codename: vivid Any ideas how to fix this D-bus bug? Best, Kevin -------------- next part -------------- An HTML attachment was scrubbed... URL: From knt261 at gmail.com Wed Mar 9 02:48:49 2016 From: knt261 at gmail.com (Kevin Truong) Date: Tue, 8 Mar 2016 17:48:49 -0800 Subject: [Qtwebengine] BUG: arguments to dbus_connection_dispatch() were incorrect In-Reply-To: References: Message-ID: Forgot to mention in case it changes anything: the new machine doesn't have any display on it. I am using Xdummy to run Qt WebEngine (an X server with a dummy video driver), and this set up works perfectly fine on the other machines with no errors or warning printed. On Tue, Mar 8, 2016 at 5:46 PM, Kevin Truong wrote: > Hi staff, > > I am using Qt WebEngine on a new machine. It didn't have problems with the > previous machines, but on the new machine when I run a Qt WebEngine > program, it outputs this error in the terminal: > > process 30346: arguments to dbus_connection_dispatch() were incorrect, > assertion "connection != NULL" failed in > file ../../dbus/dbus-connection.c line 4559. > This is normally a bug in some application using the D-Bus library. > > The program still runs fine and everything is rendered correctly, although > it seems much slower. I confirmed this is due to the QT code because when I > comment out anything that uses QtApplication, this message stops being > printed. > > I built Qt5 and Qt WebEngine via the github repo ( > https://github.com/qtproject/qt5), and tried both versions 5.6 and 5.5. > The machine I am using is ubuntu. > > uname -a: > Linux test-render3 3.19.0-51-generic #57-Ubuntu SMP Fri Feb 19 14:05:05 > UTC 2016 x86_64 x86_64 x86_64 GNU/Linux > > lsb_release -a: > No LSB modules are available. > Distributor ID: Ubuntu > Description: Ubuntu 15.04 > Release: 15.04 > Codename: vivid > > > Any ideas how to fix this D-bus bug? > > Best, > Kevin > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jp.kuraisu at gmail.com Thu Mar 10 16:01:54 2016 From: jp.kuraisu at gmail.com (Aleksey Yermakov) Date: Thu, 10 Mar 2016 18:01:54 +0300 Subject: [Qtwebengine] Detect crash of page process Message-ID: Hi, My QtWebEngine app sometimes experience crashes after sleep/hibernation which is easily fixed by page reload. Is there a way (a signal?) to detect a crash of a page process? If not, I'm ready to implement it. I've added applicationCache and ServiceWorker support to QtWebEngine back in December, so I have some understanding of the code base, but if some of you have any insight where I should look first, I would appreciate if you share it. Cheers, Aleksey -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kai.Koehne at theqtcompany.com Thu Mar 10 16:08:59 2016 From: Kai.Koehne at theqtcompany.com (Koehne Kai) Date: Thu, 10 Mar 2016 15:08:59 +0000 Subject: [Qtwebengine] Detect crash of page process In-Reply-To: References: Message-ID: > -----Original Message----- > From: QtWebEngine [mailto:qtwebengine- > bounces+kai.koehne=theqtcompany.com at qt-project.org] On Behalf Of > Aleksey Yermakov > Sent: Thursday, March 10, 2016 4:02 PM > To: qtwebengine at qt-project.org > Subject: [Qtwebengine] Detect crash of page process > > Hi, > > My QtWebEngine app sometimes experience crashes after > sleep/hibernation which is easily fixed by page reload. > > Is there a way (a signal?) to detect a crash of a page process? If not, I'm > ready to implement it. Qt 5.6 will feature a renderProcessTerminated signal http://doc-snapshots.qt.io/qt5-5.6/qwebengineview.html#renderProcessTerminated http://doc-snapshots.qt.io/qt5-5.6/qml-qtwebengine-webengineview.html#renderProcessTerminated-signal Regards Kai From jp.kuraisu at gmail.com Thu Mar 10 16:09:19 2016 From: jp.kuraisu at gmail.com (Aleksey Yermakov) Date: Thu, 10 Mar 2016 18:09:19 +0300 Subject: [Qtwebengine] Restart chromium graphics subsystem Message-ID: Hi, On MS Surface tablet I have a problem, when device goes back from sleep my QtWebEngine app shows just black screen or sometimes other graphical artifacts. I think there is a problem in graphics subsystem, maybe in ANGLE and/or drivers. Is there a way to restart graphical subsystem in QtWebEngine? I've tried to recreate QWebEngineView but run into race condition issues with QtWebEngineProcess.exe. I haven't spend much time on it, so maybe this is a better way to circumvent the problem. Also, I have a strange problem, where on MS Surface webpage looks scaled down. I think there might be a problem with detecting DPI of the system. P.S. This problem is not reproducible in Chrome. -- Aleksey Yermakov -------------- next part -------------- An HTML attachment was scrubbed... URL: From jp.kuraisu at gmail.com Thu Mar 10 16:14:12 2016 From: jp.kuraisu at gmail.com (Aleksey Yermakov) Date: Thu, 10 Mar 2016 18:14:12 +0300 Subject: [Qtwebengine] Detect crash of page process In-Reply-To: References: Message-ID: Hi Kai, That's exactly what I needed. Thank you. Do you know an effective way to crash render process for testing purposes? Regards, Aleksey On Thu, Mar 10, 2016 at 6:08 PM, Koehne Kai wrote: > > > > -----Original Message----- > > From: QtWebEngine [mailto:qtwebengine- > > bounces+kai.koehne=theqtcompany.com at qt-project.org] On Behalf Of > > Aleksey Yermakov > > Sent: Thursday, March 10, 2016 4:02 PM > > To: qtwebengine at qt-project.org > > Subject: [Qtwebengine] Detect crash of page process > > > > Hi, > > > > My QtWebEngine app sometimes experience crashes after > > sleep/hibernation which is easily fixed by page reload. > > > > Is there a way (a signal?) to detect a crash of a page process? If not, > I'm > > ready to implement it. > > Qt 5.6 will feature a renderProcessTerminated signal > > > http://doc-snapshots.qt.io/qt5-5.6/qwebengineview.html#renderProcessTerminated > > > http://doc-snapshots.qt.io/qt5-5.6/qml-qtwebengine-webengineview.html#renderProcessTerminated-signal > > Regards > > Kai > > -- Aleksey Yermakov -------------- next part -------------- An HTML attachment was scrubbed... URL: From allan.jensen at theqtcompany.com Thu Mar 10 19:18:52 2016 From: allan.jensen at theqtcompany.com (Allan Sandfeld Jensen) Date: Thu, 10 Mar 2016 19:18:52 +0100 Subject: [Qtwebengine] Detect crash of page process In-Reply-To: References: Message-ID: <201603101918.53071.allan.jensen@theqtcompany.com> You can navigate to chrome://crash It is one of the few Chrome URLs that always works as expected. You can also look for the QtWebEngineProcess and kill it. `Allan On Thursday 10 March 2016, Aleksey Yermakov wrote: > Hi Kai, > > That's exactly what I needed. Thank you. > > Do you know an effective way to crash render process for testing purposes? > > Regards, > Aleksey > > On Thu, Mar 10, 2016 at 6:08 PM, Koehne Kai > > wrote: > > > -----Original Message----- > > > From: QtWebEngine [mailto:qtwebengine- > > > bounces+kai.koehne=theqtcompany.com at qt-project.org] On Behalf Of > > > Aleksey Yermakov > > > Sent: Thursday, March 10, 2016 4:02 PM > > > To: qtwebengine at qt-project.org > > > Subject: [Qtwebengine] Detect crash of page process > > > > > > Hi, > > > > > > My QtWebEngine app sometimes experience crashes after > > > sleep/hibernation which is easily fixed by page reload. > > > > > > Is there a way (a signal?) to detect a crash of a page process? If not, > > > > I'm > > > > > ready to implement it. > > > > Qt 5.6 will feature a renderProcessTerminated signal > > > > > > http://doc-snapshots.qt.io/qt5-5.6/qwebengineview.html#renderProcessTermi > > nated > > > > > > http://doc-snapshots.qt.io/qt5-5.6/qml-qtwebengine-webengineview.html#ren > > derProcessTerminated-signal > > > > Regards > > > > Kai -- The Qt Company Rudower Chausse 13, 12489 D-Berlin The Qt Company is a group company of Digia Plc, Valimotie 21, FI-00380 Helsinki Finland From jp.kuraisu at gmail.com Thu Mar 10 19:29:48 2016 From: jp.kuraisu at gmail.com (Aleksey Yermakov) Date: Thu, 10 Mar 2016 21:29:48 +0300 Subject: [Qtwebengine] Detect crash of page process In-Reply-To: <201603101918.53071.allan.jensen@theqtcompany.com> References: <201603101918.53071.allan.jensen@theqtcompany.com> Message-ID: Hi Allan, Thanks, I'll check chrome://crash. I tried killing QtWebEngineProcess but QWebEngineView didn't show crash page and just stopped responding. I haven't tested yet, but I'm not sure I'll be able to catch this signal that way. I'll try later though. Cheers, Aleksey On Thu, Mar 10, 2016 at 9:18 PM, Allan Sandfeld Jensen < allan.jensen at theqtcompany.com> wrote: > You can navigate to chrome://crash > > It is one of the few Chrome URLs that always works as expected. > > You can also look for the QtWebEngineProcess and kill it. > > `Allan > On Thursday 10 March 2016, Aleksey Yermakov wrote: > > Hi Kai, > > > > That's exactly what I needed. Thank you. > > > > Do you know an effective way to crash render process for testing > purposes? > > > > Regards, > > Aleksey > > > > On Thu, Mar 10, 2016 at 6:08 PM, Koehne Kai > > > > > wrote: > > > > -----Original Message----- > > > > From: QtWebEngine [mailto:qtwebengine- > > > > bounces+kai.koehne=theqtcompany.com at qt-project.org] On Behalf Of > > > > Aleksey Yermakov > > > > Sent: Thursday, March 10, 2016 4:02 PM > > > > To: qtwebengine at qt-project.org > > > > Subject: [Qtwebengine] Detect crash of page process > > > > > > > > Hi, > > > > > > > > My QtWebEngine app sometimes experience crashes after > > > > sleep/hibernation which is easily fixed by page reload. > > > > > > > > Is there a way (a signal?) to detect a crash of a page process? If > not, > > > > > > I'm > > > > > > > ready to implement it. > > > > > > Qt 5.6 will feature a renderProcessTerminated signal > > > > > > > > > > http://doc-snapshots.qt.io/qt5-5.6/qwebengineview.html#renderProcessTermi > > > nated > > > > > > > > > > http://doc-snapshots.qt.io/qt5-5.6/qml-qtwebengine-webengineview.html#ren > > > derProcessTerminated-signal > > > > > > Regards > > > > > > Kai > > > -- > > The Qt Company > Rudower Chausse 13, 12489 D-Berlin > > The Qt Company is a group company of Digia Plc, > Valimotie 21, FI-00380 Helsinki Finland > -- Aleksey Yermakov -------------- next part -------------- An HTML attachment was scrubbed... URL: From jp.kuraisu at gmail.com Fri Mar 11 15:02:08 2016 From: jp.kuraisu at gmail.com (Aleksey Yermakov) Date: Fri, 11 Mar 2016 17:02:08 +0300 Subject: [Qtwebengine] Detect crash of page process In-Reply-To: References: <201603101918.53071.allan.jensen@theqtcompany.com> Message-ID: Hi, I've tried to call QWebEngineView::reload() on renderProcessTerminated signal. And when doing both chrome://crash and killing QtWebEngineProcess application crashes. Is there some way to recover from render process crash? Here is the error message and the backtrace: [0311/165832:FATAL:mojo_application_host.cc(93)] Check failed: client_handle_.is_valid(). Backtrace: GetHandleVerifier [0x11A21F21+278721] QtWebEngineCore::CookieMonsterDelegateQt::canSetCookie [0x11973FDF+1258623] QtWebEngineCore::FilePickerController::qt_static_metacall [0x10923A8A+7956410] QtWebEngineCore::FilePickerController::qt_static_metacall [0x1070D2C5+5767157] QtWebEngineCore::FilePickerController::qt_static_metacall [0x108AE4E9+7475737] QtWebEngineCore::FilePickerController::qt_static_metacall [0x108AD8E4+7472660] QtWebEngineCore::FilePickerController::qt_static_metacall [0x108AEF77+7478439] QtWebEngineCore::FilePickerController::qt_static_metacall [0x108AE25E+7475086] QtWebEngineCore::FilePickerController::qt_static_metacall [0x108AECED+7477789] QtWebEngineCore::FilePickerController::qt_static_metacall [0x108AEA3A+7477098] QtWebEngineCore::FilePickerController::qt_static_metacall [0x108AE164+7474836] QtWebEngineCore::FilePickerController::qt_static_metacall [0x108AEC20+7477584] QtWebEngineCore::BrowserContextAdapter::customUrlSchemeHandlers [0x116F062F+2140767] GetHandleVerifier [0x11A3E4CD+394861] QtWebEngineCore::CookieMonsterDelegateQt::canSetCookie [0x11983C88+1323304] QtWebEngineCore::CookieMonsterDelegateQt::canSetCookie [0x119823C4+1316964] QtWebEngineCore::CookieMonsterDelegateQt::canSetCookie [0x1198290D+1318317] QtWebEngineCore::RenderWidgetHostViewQtDelegateClient::~RenderWidgetHostViewQtDelegateClient [0x1011EDA7+77687] QtWebEngineCore::RenderWidgetHostViewQtDelegateClient::~RenderWidgetHostViewQtDelegateClient [0x1011EC27+77303] uppercasebase [0x669D4771+3241114] QSpacerItem::geometry [0x647378FB+217080] QSpacerItem::geometry [0x64733CEE+201707] uppercasebase [0x6698F86C+2958741] uppercasebase [0x66998409+2994482] uppercasebase [0x66990B66+2963599] uppercasebase [0x66A242D4+3567613] qt_plugin_query_metadata [0x024F5C70+659833] uppercasebase [0x66A2268A+3560371] gapfnScSendMessage [0x76E462FA+818] GetThreadDesktop [0x76E46D3A+215] CharPrevW [0x76E477C4+312] DispatchMessageW [0x76E4788A+15] uppercasebase [0x66A2300E+3562807] qt_plugin_query_metadata [0x024F5C48+659793] uppercasebase [0x6698B32C+2941013] uppercasebase [0x6698B537+2941536] uppercasebase [0x6698DBB2+2951387] QOpenGLFunctions_1_4::initializeOpenGLFunctions [0x0F4875F8+414398] QSpacerItem::geometry [0x64733949+200774] main [0x000E2606+310] (d:\qtprojects\qtwebengine-renderprocessterminated-test\main.cpp:16) WinMain [0x000E555D+173] (c:\qt\5.6-git\src\qtbase\src\winmain\qtmain_win.cpp:113) __tmainCRTStartup [0x000E493F+575] (f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c:618) WinMainCRTStartup [0x000E46FD+13] (f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c:466) BaseThreadInitThunk [0x76BB33AA+18] RtlInitializeExceptionChain [0x77459EF2+99] RtlInitializeExceptionChain [0x77459EC5+54] On Thu, Mar 10, 2016 at 9:29 PM, Aleksey Yermakov wrote: > Hi Allan, > > Thanks, I'll check chrome://crash. I tried killing QtWebEngineProcess but > QWebEngineView didn't show crash page and just stopped responding. I > haven't tested yet, but I'm not sure I'll be able to catch this signal that > way. I'll try later though. > > Cheers, > Aleksey > > On Thu, Mar 10, 2016 at 9:18 PM, Allan Sandfeld Jensen < > allan.jensen at theqtcompany.com> wrote: > >> You can navigate to chrome://crash >> >> It is one of the few Chrome URLs that always works as expected. >> >> You can also look for the QtWebEngineProcess and kill it. >> >> `Allan >> On Thursday 10 March 2016, Aleksey Yermakov wrote: >> > Hi Kai, >> > >> > That's exactly what I needed. Thank you. >> > >> > Do you know an effective way to crash render process for testing >> purposes? >> > >> > Regards, >> > Aleksey >> > >> > On Thu, Mar 10, 2016 at 6:08 PM, Koehne Kai < >> Kai.Koehne at theqtcompany.com> >> > >> > wrote: >> > > > -----Original Message----- >> > > > From: QtWebEngine [mailto:qtwebengine- >> > > > bounces+kai.koehne=theqtcompany.com at qt-project.org] On Behalf Of >> > > > Aleksey Yermakov >> > > > Sent: Thursday, March 10, 2016 4:02 PM >> > > > To: qtwebengine at qt-project.org >> > > > Subject: [Qtwebengine] Detect crash of page process >> > > > >> > > > Hi, >> > > > >> > > > My QtWebEngine app sometimes experience crashes after >> > > > sleep/hibernation which is easily fixed by page reload. >> > > > >> > > > Is there a way (a signal?) to detect a crash of a page process? If >> not, >> > > >> > > I'm >> > > >> > > > ready to implement it. >> > > >> > > Qt 5.6 will feature a renderProcessTerminated signal >> > > >> > > >> > > >> http://doc-snapshots.qt.io/qt5-5.6/qwebengineview.html#renderProcessTermi >> > > nated >> > > >> > > >> > > >> http://doc-snapshots.qt.io/qt5-5.6/qml-qtwebengine-webengineview.html#ren >> > > derProcessTerminated-signal >> > > >> > > Regards >> > > >> > > Kai >> >> >> -- >> >> The Qt Company >> Rudower Chausse 13, 12489 D-Berlin >> >> The Qt Company is a group company of Digia Plc, >> Valimotie 21, FI-00380 Helsinki Finland >> > > > > -- > Aleksey Yermakov > > -- Aleksey Yermakov -------------- next part -------------- An HTML attachment was scrubbed... URL: From jp.kuraisu at gmail.com Wed Mar 16 14:32:36 2016 From: jp.kuraisu at gmail.com (Aleksey Yermakov) Date: Wed, 16 Mar 2016 16:32:36 +0300 Subject: [Qtwebengine] Detect crash of page process In-Reply-To: References: <201603101918.53071.allan.jensen@theqtcompany.com> Message-ID: Hi, Found a simple fix for my problem, but it looks more like a workaround than a proper solution. I scheduled QWebEngineView::reload to run not exactly at QWebEngineView::renderProcessTerminated but after it: - connect(m_viewer, &QWebEngineView::renderProcessTerminated, m_viewer, &QWebEngineView::reload); + connect(m_viewer, &QWebEngineView::renderProcessTerminated, [=]() { QTimer::singleShot(0, m_viewer, &QWebEngineView::reload); }); I think there should be at least some mention in the docs, that you should not call reload or setUrl on renderProcessTerminated. Or better yet a fix that will allow to call this methods on renderProcessTerminated. Cheers, Aleksey Yermakov -------------- next part -------------- An HTML attachment was scrubbed... URL: From norulez at me.com Sun Mar 20 19:30:20 2016 From: norulez at me.com (NoRulez) Date: Sun, 20 Mar 2016 19:30:20 +0100 Subject: [Qtwebengine] Inject QWebChannel and/or JQuery into QWebEnginePage Message-ID: Hello, Did I have to inject QWebChannel and for example JQuery every time before or after I call setUrl()/load() to QWebEngineView or only once? Because the jquery event for loading a site is only called once and if loaded then it has the previous url: $(window).load(function () { alert('page is loaded'); alert(window.location.href); }); Thanks in advance Best Regards From jp.kuraisu at gmail.com Mon Mar 21 15:48:56 2016 From: jp.kuraisu at gmail.com (Aleksey Yermakov) Date: Mon, 21 Mar 2016 17:48:56 +0300 Subject: [Qtwebengine] Inject QWebChannel and/or JQuery into QWebEnginePage In-Reply-To: References: Message-ID: Hi, You don't have to inject QWebChannel.js every time if you use QWebEngineScriptCollection in your QWebEngineProfile. Here is a sample code from my project: const char s_qWebChannelAdditionalScript[] = "new QWebChannel(qt.webChannelTransport, function(channel) {" " window.exported_object = channel.objects.exported_object;" "});"; QWebEngineProfile *WebEngineView::prepareProfile() { QWebEngineProfile *profile = new QWebEngineProfile("Profile", this); ... // Preparing qwebchannel.js for injection QFile qWebChannelJsFile(":/qtwebchannel/qwebchannel.js"); if(! qWebChannelJsFile.open(QIODevice::ReadOnly)) { MY_ERROR("Failed to load qwebchannel.js with error: " + qWebChannelJsFile.errorString()); } else { QByteArray qWebChannelJs = qWebChannelJsFile.readAll(); qWebChannelJs.append(QString(s_qWebChannelAdditionalScript)); QWebEngineScript script; script.setSourceCode(qWebChannelJs); script.setName("qwebchannel.js"); script.setWorldId(QWebEngineScript::MainWorld); script.setInjectionPoint(QWebEngineScript::DocumentCreation); script.setRunsOnSubFrames(false); profile->scripts()->insert(script); } return profile; } Don't forget to create your QWebEnginePage with this profile instead of default one. Cheers, Aleksey On Sun, Mar 20, 2016 at 9:30 PM, NoRulez wrote: > Hello, > > Did I have to inject QWebChannel and for example JQuery every time before > or after I call setUrl()/load() to QWebEngineView or only once? > > Because the jquery event for loading a site is only called once and if > loaded then it has the previous url: > > $(window).load(function () { > alert('page is loaded'); > alert(window.location.href); > }); > > Thanks in advance > > Best Regards > > _______________________________________________ > QtWebEngine mailing list > QtWebEngine at qt-project.org > http://lists.qt-project.org/mailman/listinfo/qtwebengine > -- Aleksey Yermakov -------------- next part -------------- An HTML attachment was scrubbed... URL: From norulez at me.com Fri Mar 25 08:11:48 2016 From: norulez at me.com (NoRulez) Date: Fri, 25 Mar 2016 08:11:48 +0100 Subject: [Qtwebengine] Inject QWebChannel and/or JQuery into QWebEnginePage In-Reply-To: References: Message-ID: Thank you very much, now it is working as expected. Best Regards > Am 21.03.2016 um 15:48 schrieb Aleksey Yermakov : > > Hi, > > You don't have to inject QWebChannel.js every time if you use QWebEngineScriptCollection in your QWebEngineProfile. Here is a sample code from my project: > > const char s_qWebChannelAdditionalScript[] = "new QWebChannel(qt.webChannelTransport, function(channel) {" > " window.exported_object = channel.objects.exported_object;" > "});"; > > QWebEngineProfile *WebEngineView::prepareProfile() > { > QWebEngineProfile *profile = new QWebEngineProfile("Profile", this); > > ... > > // Preparing qwebchannel.js for injection > QFile qWebChannelJsFile(":/qtwebchannel/qwebchannel.js"); > > if(! qWebChannelJsFile.open(QIODevice::ReadOnly)) { > MY_ERROR("Failed to load qwebchannel.js with error: " + qWebChannelJsFile.errorString()); > } else { > QByteArray qWebChannelJs = qWebChannelJsFile.readAll(); > > qWebChannelJs.append(QString(s_qWebChannelAdditionalScript)); > > QWebEngineScript script; > > script.setSourceCode(qWebChannelJs); > script.setName("qwebchannel.js"); > script.setWorldId(QWebEngineScript::MainWorld); > script.setInjectionPoint(QWebEngineScript::DocumentCreation); > script.setRunsOnSubFrames(false); > > profile->scripts()->insert(script); > } > > return profile; > } > > Don't forget to create your QWebEnginePage with this profile instead of default one. > > Cheers, > Aleksey > >> On Sun, Mar 20, 2016 at 9:30 PM, NoRulez wrote: >> Hello, >> >> Did I have to inject QWebChannel and for example JQuery every time before or after I call setUrl()/load() to QWebEngineView or only once? >> >> Because the jquery event for loading a site is only called once and if loaded then it has the previous url: >> >> $(window).load(function () { >> alert('page is loaded'); >> alert(window.location.href); >> }); >> >> Thanks in advance >> >> Best Regards >> >> _______________________________________________ >> QtWebEngine mailing list >> QtWebEngine at qt-project.org >> http://lists.qt-project.org/mailman/listinfo/qtwebengine > > > > -- > Aleksey Yermakov > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jp.kuraisu at gmail.com Mon Mar 14 15:12:38 2016 From: jp.kuraisu at gmail.com (Aleksey Yermakov) Date: Mon, 14 Mar 2016 14:12:38 -0000 Subject: [Qtwebengine] Detect crash of page process In-Reply-To: References: <201603101918.53071.allan.jensen@theqtcompany.com> Message-ID: Hi, I've tried to reload QWebEngineView after renderProcessTerminated. I'm deleting QWebEngineView and creating a new one. To crash render process I just kill QtWebEngineProcess. I'm able to create a new QWebEngineView just ok, but having problems with sqlite somewhere in QtWebEngine code, possibly in QuotaDatabase. Backtrace dumped to stderr after crash shows something strange, but VS2013 callstack shows calls from QuotaDatabase. Backtrace: [0314/164228:FATAL:connection.cc(1291)] database is locked Backtrace: GetHandleVerifier [0x11A21F21+278721] QtWebEngineCore::CookieMonsterDelegateQt::canSetCookie [0x11973FDF+1258623] QtWebEngineCore::RenderWidgetHostViewQtDelegateClient::operator= [0x121C1C86+5572854] QtWebEngineCore::RenderWidgetHostViewQtDelegateClient::operator= [0x121C620C+5590652] QtWebEngineCore::RenderWidgetHostViewQtDelegateClient::operator= [0x121C6FEA+5594202] QtWebEngineCore::RenderWidgetHostViewQtDelegateClient::operator= [0x121C6C8F+5593343] QtWebEngineCore::RenderWidgetHostViewQtDelegateClient::operator= [0x124D5E2C+8800924] QtWebEngineCore::RenderWidgetHostViewQtDelegateClient::operator= [0x1249CA66+8566486] QtWebEngineCore::RenderWidgetHostViewQtDelegateClient::operator= [0x1249BDE6+8563286] QtWebEngineCore::RenderWidgetHostViewQtDelegateClient::operator= [0x1249A36F+8556511] QtWebEngineCore::RenderWidgetHostViewQtDelegateClient::operator= [0x1249B766+8561622] QtWebEngineCore::URLRequestCustomJobDelegate::qt_static_metacall [0x11AC7B1C+195052] QtWebEngineCore::RenderWidgetHostViewQtDelegateClient::operator= [0x1249A2D0+8556352] QtWebEngineCore::RenderWidgetHostViewQtDelegateClient::operator= [0x1249BBFB+8562795] QtWebEngineCore::BrowserContextAdapter::customUrlSchemeHandlers [0x116F062F+2140767] QtWebEngineCore::FilePickerController::qt_static_metacall [0x107E950B+6668859] QtWebEngineCore::FilePickerController::qt_static_metacall [0x10B69E44+10341236] QtWebEngineCore::FilePickerController::qt_static_metacall [0x1086B0A5+7200213] QtWebEngineCore::FilePickerController::qt_static_metacall [0x1082C79F+6943951] QtWebEngineCore::BrowserContextAdapter::customUrlSchemeHandlers [0x116F062F+2140767] GetHandleVerifier [0x11A3B005+381349] QtWebEngineCore::RenderWidgetHostViewQtDelegateClient::operator= [0x123809BB+7403051] QtWebEngineCore::BrowserContextAdapter::browserContext [0x11089BFA+5313082] QtWebEngineCore::FilePickerController::qt_static_metacall [0x10A7B118+9363016] QtWebEngineCore::BrowserContextAdapter::customUrlSchemeHandlers [0x116F062F+2140767] GetHandleVerifier [0x11A3E4CD+394861] QtWebEngineCore::CookieMonsterDelegateQt::canSetCookie [0x11983C88+1323304] QtWebEngineCore::CookieMonsterDelegateQt::canSetCookie [0x119823C4+1316964] QtWebEngineCore::CookieMonsterDelegateQt::canSetCookie [0x1198290D+1318317] GetHandleVerifier [0x11A437E4+416132] QtWebEngineCore::CookieMonsterDelegateQt::canSetCookie [0x11983A97+1322807] QtWebEngineCore::CookieMonsterDelegateQt::canSetCookie [0x119B3486+1517862] QtWebEngineCore::CookieMonsterDelegateQt::canSetCookie [0x1198394D+1322477] QtWebEngineCore::CookieMonsterDelegateQt::canSetCookie [0x119C9F56+1610742] QtWebEngineCore::FilePickerController::qt_static_metacall [0x106078D4+4695556] QtWebEngineCore::FilePickerController::qt_static_metacall [0x10608B86+4700342] QtWebEngineCore::CookieMonsterDelegateQt::canSetCookie [0x119CAA59+1613561] QtWebEngineCore::CookieMonsterDelegateQt::canSetCookie [0x119D1826+1641670] BaseThreadInitThunk [0x76B233AA+18] RtlInitializeExceptionChain [0x77729EF2+99] RtlInitializeExceptionChain [0x77729EC5+54] The program has unexpectedly finished. And here is a call stack I get from VS2013: Qt5WebEngineCored.dll!base::debug::BreakDebugger() Line 21 Qt5WebEngineCored.dll!logging::LogMessage::~LogMessage() Line 642 Qt5WebEngineCored.dll!sql::Connection::OnSqliteError(int err, sql::Statement * stmt, const char * sql) Line 1292 Qt5WebEngineCored.dll!sql::Statement::CheckError(int err) Line 354 Qt5WebEngineCored.dll!sql::Statement::StepInternal(bool timer_flag) Line 82 Qt5WebEngineCored.dll!sql::Statement::Run() Line 86 Qt5WebEngineCored.dll!storage::QuotaDatabase::SetOriginLastAccessTime(const GURL & origin, storage::StorageType type, base::Time last_access_time) Line 210 Qt5WebEngineCored.dll!storage::`anonymous namespace'::UpdateAccessTimeOnDBThread(const GURL & origin, storage::StorageType type, base::Time accessed_time, storage::QuotaDatabase * database) Line 180 Qt5WebEngineCored.dll!base::internal::RunnableAdapter::Run(const GURL & , const storage::StorageType & , const base::Time & , storage::QuotaDatabase * const & ) Line 158 Qt5WebEngineCored.dll!base::internal::InvokeHelper<0,bool,base::internal::RunnableAdapter,base::internal::TypeList >::MakeItSo(base::internal::RunnableAdapter runnable, const GURL & , const storage::StorageType & , const base::Time & , storage::QuotaDatabase * const & ) Line 287 Qt5WebEngineCored.dll!base::internal::Invoker,base::internal::BindState,bool __cdecl(GURL const & __ptr64,enum storage::StorageType,base::Time,storage::QuotaDatabase * __ptr64),base::internal::TypeList >,base::internal::TypeList,base::internal::UnwrapTraits,base::internal::UnwrapTraits >,base::internal::InvokeHelper<0,bool,base::internal::RunnableAdapter,base::internal::TypeList >,bool __cdecl(storage::QuotaDatabase * __ptr64 const & __ptr64)>::Run(base::internal::BindStateBase * base, storage::QuotaDatabase * const & ) Line 347 Qt5WebEngineCored.dll!base::Callback::Run(content::DownloadItemImpl * const & ) Line 397 Qt5WebEngineCored.dll!base::internal::InvokeHelper<0,bool,base::Callback,base::internal::TypeList >::MakeItSo(base::Callback runnable, storage::QuotaDatabase * ) Line 286 Qt5WebEngineCored.dll!base::internal::Invoker,base::internal::BindState,bool __cdecl(storage::QuotaDatabase * __ptr64),base::internal::TypeList > >,base::internal::TypeList > >,base::internal::InvokeHelper<0,bool,base::Callback,base::internal::TypeList >,bool __cdecl(void)>::Run(base::internal::BindStateBase * base) Line 347 Qt5WebEngineCored.dll!base::Callback::Run() Line 397 Qt5WebEngineCored.dll!base::internal::ReturnAsParamAdapter(const base::Callback & func, bool * result) Line 23 Qt5WebEngineCored.dll!base::internal::RunnableAdapter >,base::DefaultDeleter > > >)> const & __ptr64,scoped_ptr >,base::DefaultDeleter > > > * __ptr64)>::Run(const base::Callback >,base::DefaultDeleter > > >)> & , scoped_ptr >,base::DefaultDeleter > > > * const & ) Line 158 Qt5WebEngineCored.dll!base::internal::InvokeHelper<0,void,base::internal::RunnableAdapter const & __ptr64,__int64)>,base::internal::TypeList const & __ptr64,__int64 const & __ptr64> >::MakeItSo(base::internal::RunnableAdapter const &,__int64)> runnable, const base::Callback & , const __int64 & ) Line 294 Qt5WebEngineCored.dll!base::internal::Invoker,base::internal::BindState,std::allocator > __cdecl(void)> const & __ptr64,std::set,std::allocator > * __ptr64)>,void __cdecl(base::Callback,std::allocator > __cdecl(void)> const & __ptr64,std::set,std::allocator > * __ptr64),base::internal::TypeList,std::allocator > __cdecl(void)>,std::set,std::allocator > * __ptr64> >,base::internal::TypeList,std::allocator > __cdecl(void)> >,base::internal::UnwrapTraits,std::allocator > * __ptr64> >,base::internal::InvokeHelper<0,void,base::internal::RunnableAdapter,std::allocator > __cdecl(void)> const & __ptr64,std::set,std::allocator > * __ptr64)>,base::internal::TypeList,std::allocator > __cdecl(void)> const & __ptr64,std::set,std::allocator > * __ptr64 const & __ptr64> >,void __cdecl(void)>::Run(base::internal::BindStateBase * base) Line 347 Qt5WebEngineCored.dll!base::Callback::Run() Line 397 Qt5WebEngineCored.dll!base::`anonymous namespace'::PostTaskAndReplyRelay::Run() Line 46 Qt5WebEngineCored.dll!base::internal::RunnableAdapter::Run(net::SQLitePersistentCookieStore::Backend * object) Line 177 Qt5WebEngineCored.dll!base::internal::InvokeHelper<0,void,base::internal::RunnableAdapter,base::internal::TypeList >::MakeItSo(base::internal::RunnableAdapter runnable, content::TouchEventQueue::TouchTimeoutHandler * ) Line 294 Qt5WebEngineCored.dll!base::internal::Invoker,base::internal::BindState,void __cdecl(net::WebSocketChannel * __ptr64),base::internal::TypeList > >,base::internal::TypeList > >,base::internal::InvokeHelper<0,void,base::internal::RunnableAdapter,base::internal::TypeList >,void __cdecl(void)>::Run(base::internal::BindStateBase * base) Line 347 Qt5WebEngineCored.dll!base::Callback::Run() Line 397 Qt5WebEngineCored.dll!base::debug::TaskAnnotator::RunTask(const char * queue_function, const char * run_function, const base::PendingTask & pending_task) Line 64 Qt5WebEngineCored.dll!base::MessageLoop::RunTask(const base::PendingTask & pending_task) Line 475 Qt5WebEngineCored.dll!base::MessageLoop::DeferOrRunPendingTask(const base::PendingTask & pending_task) Line 485 Qt5WebEngineCored.dll!base::MessageLoop::DoWork() Line 594 Qt5WebEngineCored.dll!base::MessagePumpDefault::Run(base::MessagePump::Delegate * delegate) Line 32 Qt5WebEngineCored.dll!base::MessageLoop::RunHandler() Line 439 Qt5WebEngineCored.dll!base::RunLoop::Run() Line 56 Qt5WebEngineCored.dll!base::MessageLoop::Run() Line 288 Qt5WebEngineCored.dll!base::Thread::Run(base::MessageLoop * message_loop) Line 199 Qt5WebEngineCored.dll!content::BrowserThreadImpl::DBThreadRun(base::MessageLoop * message_loop) Line 178 Qt5WebEngineCored.dll!content::BrowserThreadImpl::Run(base::MessageLoop * message_loop) Line 236 Qt5WebEngineCored.dll!base::Thread::ThreadMain() Line 251 Qt5WebEngineCored.dll!base::`anonymous namespace'::ThreadFunc(void * params) Line 86 Is there some kind of a clean way to reinitialize QtWebEngine in Qt application short of full apllication restart? If not, then maybe someone can point me to a way to fix this error with locked database? Cheers, Aleksey On Fri, Mar 11, 2016 at 5:02 PM, Aleksey Yermakov wrote: > Hi, > > I've tried to call QWebEngineView::reload() on renderProcessTerminated > signal. And when doing both chrome://crash and killing QtWebEngineProcess > application crashes. > > Is there some way to recover from render process crash? > > Here is the error message and the backtrace: > > [0311/165832:FATAL:mojo_application_host.cc(93)] Check failed: > client_handle_.is_valid(). > Backtrace: > GetHandleVerifier [0x11A21F21+278721] > QtWebEngineCore::CookieMonsterDelegateQt::canSetCookie [0x11973FDF+1258623] > QtWebEngineCore::FilePickerController::qt_static_metacall > [0x10923A8A+7956410] > QtWebEngineCore::FilePickerController::qt_static_metacall > [0x1070D2C5+5767157] > QtWebEngineCore::FilePickerController::qt_static_metacall > [0x108AE4E9+7475737] > QtWebEngineCore::FilePickerController::qt_static_metacall > [0x108AD8E4+7472660] > QtWebEngineCore::FilePickerController::qt_static_metacall > [0x108AEF77+7478439] > QtWebEngineCore::FilePickerController::qt_static_metacall > [0x108AE25E+7475086] > QtWebEngineCore::FilePickerController::qt_static_metacall > [0x108AECED+7477789] > QtWebEngineCore::FilePickerController::qt_static_metacall > [0x108AEA3A+7477098] > QtWebEngineCore::FilePickerController::qt_static_metacall > [0x108AE164+7474836] > QtWebEngineCore::FilePickerController::qt_static_metacall > [0x108AEC20+7477584] > QtWebEngineCore::BrowserContextAdapter::customUrlSchemeHandlers > [0x116F062F+2140767] > GetHandleVerifier [0x11A3E4CD+394861] > QtWebEngineCore::CookieMonsterDelegateQt::canSetCookie [0x11983C88+1323304] > QtWebEngineCore::CookieMonsterDelegateQt::canSetCookie [0x119823C4+1316964] > QtWebEngineCore::CookieMonsterDelegateQt::canSetCookie [0x1198290D+1318317] > QtWebEngineCore::RenderWidgetHostViewQtDelegateClient::~RenderWidgetHostViewQtDelegateClient > [0x1011EDA7+77687] > QtWebEngineCore::RenderWidgetHostViewQtDelegateClient::~RenderWidgetHostViewQtDelegateClient > [0x1011EC27+77303] > uppercasebase [0x669D4771+3241114] > QSpacerItem::geometry [0x647378FB+217080] > QSpacerItem::geometry [0x64733CEE+201707] > uppercasebase [0x6698F86C+2958741] > uppercasebase [0x66998409+2994482] > uppercasebase [0x66990B66+2963599] > uppercasebase [0x66A242D4+3567613] > qt_plugin_query_metadata [0x024F5C70+659833] > uppercasebase [0x66A2268A+3560371] > gapfnScSendMessage [0x76E462FA+818] > GetThreadDesktop [0x76E46D3A+215] > CharPrevW [0x76E477C4+312] > DispatchMessageW [0x76E4788A+15] > uppercasebase [0x66A2300E+3562807] > qt_plugin_query_metadata [0x024F5C48+659793] > uppercasebase [0x6698B32C+2941013] > uppercasebase [0x6698B537+2941536] > uppercasebase [0x6698DBB2+2951387] > QOpenGLFunctions_1_4::initializeOpenGLFunctions [0x0F4875F8+414398] > QSpacerItem::geometry [0x64733949+200774] > main [0x000E2606+310] > (d:\qtprojects\qtwebengine-renderprocessterminated-test\main.cpp:16) > WinMain [0x000E555D+173] > (c:\qt\5.6-git\src\qtbase\src\winmain\qtmain_win.cpp:113) > __tmainCRTStartup [0x000E493F+575] > (f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c:618) > WinMainCRTStartup [0x000E46FD+13] > (f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c:466) > BaseThreadInitThunk [0x76BB33AA+18] > RtlInitializeExceptionChain [0x77459EF2+99] > RtlInitializeExceptionChain [0x77459EC5+54] > > On Thu, Mar 10, 2016 at 9:29 PM, Aleksey Yermakov > wrote: > >> Hi Allan, >> >> Thanks, I'll check chrome://crash. I tried killing QtWebEngineProcess but >> QWebEngineView didn't show crash page and just stopped responding. I >> haven't tested yet, but I'm not sure I'll be able to catch this signal that >> way. I'll try later though. >> >> Cheers, >> Aleksey >> >> On Thu, Mar 10, 2016 at 9:18 PM, Allan Sandfeld Jensen < >> allan.jensen at theqtcompany.com> wrote: >> >>> You can navigate to chrome://crash >>> >>> It is one of the few Chrome URLs that always works as expected. >>> >>> You can also look for the QtWebEngineProcess and kill it. >>> >>> `Allan >>> On Thursday 10 March 2016, Aleksey Yermakov wrote: >>> > Hi Kai, >>> > >>> > That's exactly what I needed. Thank you. >>> > >>> > Do you know an effective way to crash render process for testing >>> purposes? >>> > >>> > Regards, >>> > Aleksey >>> > >>> > On Thu, Mar 10, 2016 at 6:08 PM, Koehne Kai < >>> Kai.Koehne at theqtcompany.com> >>> > >>> > wrote: >>> > > > -----Original Message----- >>> > > > From: QtWebEngine [mailto:qtwebengine- >>> > > > bounces+kai.koehne=theqtcompany.com at qt-project.org] On Behalf Of >>> > > > Aleksey Yermakov >>> > > > Sent: Thursday, March 10, 2016 4:02 PM >>> > > > To: qtwebengine at qt-project.org >>> > > > Subject: [Qtwebengine] Detect crash of page process >>> > > > >>> > > > Hi, >>> > > > >>> > > > My QtWebEngine app sometimes experience crashes after >>> > > > sleep/hibernation which is easily fixed by page reload. >>> > > > >>> > > > Is there a way (a signal?) to detect a crash of a page process? If >>> not, >>> > > >>> > > I'm >>> > > >>> > > > ready to implement it. >>> > > >>> > > Qt 5.6 will feature a renderProcessTerminated signal >>> > > >>> > > >>> > > >>> http://doc-snapshots.qt.io/qt5-5.6/qwebengineview.html#renderProcessTermi >>> > > nated >>> > > >>> > > >>> > > >>> http://doc-snapshots.qt.io/qt5-5.6/qml-qtwebengine-webengineview.html#ren >>> > > derProcessTerminated-signal >>> > > >>> > > Regards >>> > > >>> > > Kai >>> >>> >>> -- >>> >>> The Qt Company >>> Rudower Chausse 13, 12489 D-Berlin >>> >>> The Qt Company is a group company of Digia Plc, >>> Valimotie 21, FI-00380 Helsinki Finland >>> >> >> >> >> -- >> Aleksey Yermakov >> >> > > > -- > Aleksey Yermakov > > -- Aleksey Yermakov -------------- next part -------------- An HTML attachment was scrubbed... URL: