From kevin at diffbot.com Tue Nov 3 20:41:40 2015 From: kevin at diffbot.com (Kevin Truong) Date: Tue, 3 Nov 2015 11:41:40 -0800 Subject: [Qtwebengine] "qmake -r" error -- unknowm model: webchannel Message-ID: Hi, I am trying to get qt webengine running on my laptop. I ran into some issues and would greatly appreciate any help. I am following the instructions from here: https://wiki.qt.io/QtWebEngineHowToTry On the last few steps, I had to run "qmake -r" on the qtwebengine directory. This is the output: SSL............................... Using system NSS ICU............................... Using internal copy (Default, force system ICU with WEBENGINE_CONFIG += use_system_icu) FFMPEG............................ Using internal copy (Default, force system FFMPEG with WEBENGINE_CONFIG += use_system_ffmpeg) Proprietary codecs (H264, MP3).... Not enabled (Default, enable with WEBENGINE_CONFIG += use_proprietary_codecs) Reading /home/kevin/workspace/qtwebengine/src/src.pro Reading /home/kevin/workspace/qtwebengine/src/core/core.pro Reading /home/kevin/workspace/qtwebengine/src/core/core_gyp_generator.pro Project ERROR: Unknown module(s) in QT: webchannel This error happened right after I installed WebKitGtk+ from here ( http://trac.webkit.org/wiki/BuildingGtk) and ran "Tools/gtk/install-dependencies" and "Tools/Scripts/update-webkitgtk-libs". (I installed WebKitGtk+ because, previously, running "qmake -r" on the qtwebengine directly resulted in an "unmet dependency: harfbuzz" error that I tried to fix on my own via google, and the WebKitGtk+ page was the only lead I could find that would supposedly fix that issue). I am running on a (mostly freshly reformatted) Ubuntu 15.04 laptop. Any help would be greatly appreciated! I would love to try out qt webengine. Thank you for your time, Kevin -------------- next part -------------- An HTML attachment was scrubbed... URL: From kevin at diffbot.com Tue Nov 3 21:08:33 2015 From: kevin at diffbot.com (Kevin Truong) Date: Tue, 3 Nov 2015 12:08:33 -0800 Subject: [Qtwebengine] "qmake -r" error -- unknowm model: webchannel In-Reply-To: References: Message-ID: I don't know if this helps, but apparently I have both qt4 and qt5 plugins installed, as well as qtchooser. Here is the output of "make --version": QMake version 3.0 Using Qt version 5.4.1 in /usr/lib/x86_64-linux-gnu I installed Qt5 via sudo apt-get. I am guessing qt4 and qtchooser was installed from the WebKitGtk+ installation scritps. On Tue, Nov 3, 2015 at 11:41 AM, Kevin Truong wrote: > Hi, > > I am trying to get qt webengine running on my laptop. I ran into some > issues and would greatly appreciate any help. I am following the > instructions from here: > > https://wiki.qt.io/QtWebEngineHowToTry > > On the last few steps, I had to run "qmake -r" on the qtwebengine > directory. This is the output: > > SSL............................... Using system NSS > ICU............................... Using internal copy (Default, force > system ICU with WEBENGINE_CONFIG += use_system_icu) > FFMPEG............................ Using internal copy (Default, force > system FFMPEG with WEBENGINE_CONFIG += use_system_ffmpeg) > Proprietary codecs (H264, MP3).... Not enabled (Default, enable > with WEBENGINE_CONFIG += use_proprietary_codecs) > Reading /home/kevin/workspace/qtwebengine/src/src.pro > Reading /home/kevin/workspace/qtwebengine/src/core/core.pro > Reading /home/kevin/workspace/qtwebengine/src/core/ > core_gyp_generator.pro > Project ERROR: Unknown module(s) in QT: webchannel > > This error happened right after I installed WebKitGtk+ from here ( > http://trac.webkit.org/wiki/BuildingGtk) and ran "Tools/gtk/install-dependencies" > and "Tools/Scripts/update-webkitgtk-libs". > > (I installed WebKitGtk+ because, previously, running "qmake -r" on the > qtwebengine directly resulted in an "unmet dependency: harfbuzz" error that > I tried to fix on my own via google, and the WebKitGtk+ page was the only > lead I could find that would supposedly fix that issue). > > I am running on a (mostly freshly reformatted) Ubuntu 15.04 laptop. > > Any help would be greatly appreciated! I would love to try out qt > webengine. > > Thank you for your time, > Kevin > -------------- next part -------------- An HTML attachment was scrubbed... URL: From patricks17092012 at gmail.com Wed Nov 4 08:52:52 2015 From: patricks17092012 at gmail.com (patrick s) Date: Wed, 4 Nov 2015 08:52:52 +0100 Subject: [Qtwebengine] Flash in 5.6 beta Message-ID: Hi everyone, i'm trying to get flash running with the 5.6 beta packages. It seems to work fine on Linux, but on Windows I can't get it to work (msvc2013_64, packages 198 and 241). When i do the check on https://helpx.adobe.com/flash-player.html it tells me that flash is installed, but not enabled (with pluginsEnabled set to true). It is working in chrome. Do i have to do anything else to get it running (use a specific flash version or put the plugin in a specific location)? Or could there be 64/32bit issues? Unfortunately there is no msvc2013_32 package (yet?) to test this. Thanks in advance, Patrick (sorry if anyone got this twice, I accidentally sent it first without being subbed to the list) -------------- next part -------------- An HTML attachment was scrubbed... URL: From Michael.Bruning at theqtcompany.com Wed Nov 4 09:25:16 2015 From: Michael.Bruning at theqtcompany.com (Bruning Michael) Date: Wed, 4 Nov 2015 08:25:16 +0000 Subject: [Qtwebengine] Flash in 5.6 beta In-Reply-To: References: Message-ID: Hi Patrick, on Windows, we currently only support the pepper Flash player on x86 / 32bit. The path that is searched is "C:/Windows/SysWOW64/Macromed/Flash/" and the DLL containing the flash player has to follow the naming convention "pepflashplayer*.dll" . Best regards, Michael ________________________________ From: QtWebEngine on behalf of patrick s Sent: Wednesday, November 4, 2015 08:52 To: qtwebengine at qt-project.org Subject: [Qtwebengine] Flash in 5.6 beta Hi everyone, i'm trying to get flash running with the 5.6 beta packages. It seems to work fine on Linux, but on Windows I can't get it to work (msvc2013_64, packages 198 and 241). When i do the check on https://helpx.adobe.com/flash-player.html it tells me that flash is installed, but not enabled (with pluginsEnabled set to true). It is working in chrome. Do i have to do anything else to get it running (use a specific flash version or put the plugin in a specific location)? Or could there be 64/32bit issues? Unfortunately there is no msvc2013_32 package (yet?) to test this. Thanks in advance, Patrick (sorry if anyone got this twice, I accidentally sent it first without being subbed to the list) -------------- next part -------------- An HTML attachment was scrubbed... URL: From Michael.Bruning at theqtcompany.com Wed Nov 4 09:28:50 2015 From: Michael.Bruning at theqtcompany.com (Bruning Michael) Date: Wed, 4 Nov 2015 08:28:50 +0000 Subject: [Qtwebengine] "qmake -r" error -- unknowm model: webchannel In-Reply-To: References: , Message-ID: Hi Kevin, the newer versions of QtWebEngine depend on the QtWebChannel and QtWebSockets modules, so you either have to build and install those as well or check out an older version of QtWebEngine that matches the Qt you have installed. Also, you might want to download a version of qt from http://download.qt.io/official_releases/qt/ Best regards, Michael ________________________________ From: QtWebEngine on behalf of Kevin Truong Sent: Tuesday, November 3, 2015 21:08 To: qtwebengine at qt-project.org Subject: Re: [Qtwebengine] "qmake -r" error -- unknowm model: webchannel I don't know if this helps, but apparently I have both qt4 and qt5 plugins installed, as well as qtchooser. Here is the output of "make --version": QMake version 3.0 Using Qt version 5.4.1 in /usr/lib/x86_64-linux-gnu I installed Qt5 via sudo apt-get. I am guessing qt4 and qtchooser was installed from the WebKitGtk+ installation scritps. On Tue, Nov 3, 2015 at 11:41 AM, Kevin Truong > wrote: Hi, I am trying to get qt webengine running on my laptop. I ran into some issues and would greatly appreciate any help. I am following the instructions from here: https://wiki.qt.io/QtWebEngineHowToTry On the last few steps, I had to run "qmake -r" on the qtwebengine directory. This is the output: SSL............................... Using system NSS ICU............................... Using internal copy (Default, force system ICU with WEBENGINE_CONFIG += use_system_icu) FFMPEG............................ Using internal copy (Default, force system FFMPEG with WEBENGINE_CONFIG += use_system_ffmpeg) Proprietary codecs (H264, MP3).... Not enabled (Default, enable with WEBENGINE_CONFIG += use_proprietary_codecs) Reading /home/kevin/workspace/qtwebengine/src/src.pro Reading /home/kevin/workspace/qtwebengine/src/core/core.pro Reading /home/kevin/workspace/qtwebengine/src/core/core_gyp_generator.pro Project ERROR: Unknown module(s) in QT: webchannel This error happened right after I installed WebKitGtk+ from here (http://trac.webkit.org/wiki/BuildingGtk) and ran "Tools/gtk/install-dependencies" and "Tools/Scripts/update-webkitgtk-libs". (I installed WebKitGtk+ because, previously, running "qmake -r" on the qtwebengine directly resulted in an "unmet dependency: harfbuzz" error that I tried to fix on my own via google, and the WebKitGtk+ page was the only lead I could find that would supposedly fix that issue). I am running on a (mostly freshly reformatted) Ubuntu 15.04 laptop. Any help would be greatly appreciated! I would love to try out qt webengine. Thank you for your time, Kevin -------------- next part -------------- An HTML attachment was scrubbed... URL: From kevin at diffbot.com Thu Nov 5 00:34:52 2015 From: kevin at diffbot.com (Kevin Truong) Date: Wed, 4 Nov 2015 15:34:52 -0800 Subject: [Qtwebengine] "qmake -r" error -- unknowm model: webchannel In-Reply-To: References: Message-ID: Hi Michael, Thanks for the suggestion! Downloading qt 5.5.0 from the link you gave fixed the issue. Best, Kevin On Wed, Nov 4, 2015 at 12:28 AM, Bruning Michael < Michael.Bruning at theqtcompany.com> wrote: > Hi Kevin, > > > the newer versions of QtWebEngine depend on the QtWebChannel and > QtWebSockets modules, so you either have to build and install those as well > or check out an older version of QtWebEngine that matches the Qt you have > installed. Also, you might want to download a version of qt from > http://download.qt.io/official_releases/qt/ > > > Best regards, > > Michael > > > ------------------------------ > *From:* QtWebEngine on behalf of > Kevin Truong > *Sent:* Tuesday, November 3, 2015 21:08 > *To:* qtwebengine at qt-project.org > *Subject:* Re: [Qtwebengine] "qmake -r" error -- unknowm model: webchannel > > I don't know if this helps, but apparently I have both qt4 and qt5 plugins > installed, as well as qtchooser. > > Here is the output of "make --version": > QMake version 3.0 > Using Qt version 5.4.1 in /usr/lib/x86_64-linux-gnu > > I installed Qt5 via sudo apt-get. I am guessing qt4 and qtchooser was > installed from the WebKitGtk+ installation scritps. > > > On Tue, Nov 3, 2015 at 11:41 AM, Kevin Truong wrote: > >> Hi, >> >> I am trying to get qt webengine running on my laptop. I ran into some >> issues and would greatly appreciate any help. I am following the >> instructions from here: >> >> https://wiki.qt.io/QtWebEngineHowToTry >> >> On the last few steps, I had to run "qmake -r" on the qtwebengine >> directory. This is the output: >> >> SSL............................... Using system NSS >> ICU............................... Using internal copy (Default, force >> system ICU with WEBENGINE_CONFIG += use_system_icu) >> FFMPEG............................ Using internal copy (Default, force >> system FFMPEG with WEBENGINE_CONFIG += use_system_ffmpeg) >> Proprietary codecs (H264, MP3).... Not enabled (Default, enable >> with WEBENGINE_CONFIG += use_proprietary_codecs) >> Reading /home/kevin/workspace/qtwebengine/src/src.pro >> Reading /home/kevin/workspace/qtwebengine/src/core/core.pro >> Reading /home/kevin/workspace/qtwebengine/src/core/ >> core_gyp_generator.pro >> Project ERROR: Unknown module(s) in QT: webchannel >> >> This error happened right after I installed WebKitGtk+ from here ( >> http://trac.webkit.org/wiki/BuildingGtk) and ran "Tools/gtk/install-dependencies" >> and "Tools/Scripts/update-webkitgtk-libs". >> >> (I installed WebKitGtk+ because, previously, running "qmake -r" on the >> qtwebengine directly resulted in an "unmet dependency: harfbuzz" error that >> I tried to fix on my own via google, and the WebKitGtk+ page was the only >> lead I could find that would supposedly fix that issue). >> >> I am running on a (mostly freshly reformatted) Ubuntu 15.04 laptop. >> >> Any help would be greatly appreciated! I would love to try out qt >> webengine. >> >> Thank you for your time, >> Kevin >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From knt261 at gmail.com Thu Nov 5 03:50:57 2015 From: knt261 at gmail.com (Kevin Truong) Date: Wed, 4 Nov 2015 18:50:57 -0800 Subject: [Qtwebengine] QWebEnginePage -- when is loadFinished() called? Message-ID: I'm creating a headless render engine, which serializes whenever loadFinished() is signaled. Because of this, I'd like to understand the details of loadFinished(). There are many definitions of being "finished" when rendering a page, including: 1. DOM has been downloaded 2. DOM has been downloaded, resources specified in the original DOM (as opposed to other scripts or iframes) have been rendered into the page (as used in phantomjs http://phantomjs.org/api/webpage/handler/on-load-finished.html) 3. The global javascript variable "window" fires the "load" event (see https://developer.mozilla.org/en-US/Add-ons/Code_snippets/On_page_load) For QWebEnginePage, is it correct to assume loadFinished() is signaled the same as #2? If not, can anyone share their insights as to what conditions must be filled for loadFinished() to signal? Many thanks! Best, Kevin -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kai.Koehne at theqtcompany.com Thu Nov 5 09:47:41 2015 From: Kai.Koehne at theqtcompany.com (Koehne Kai) Date: Thu, 5 Nov 2015 08:47:41 +0000 Subject: [Qtwebengine] QWebEnginePage -- when is loadFinished() called? In-Reply-To: References: Message-ID: > -----Original Message----- > From: QtWebEngine [mailto:qtwebengine-bounces at qt-project.org] On Behalf > Of Kevin Truong > Sent: Thursday, November 05, 2015 3:51 AM > To: qtwebengine at qt-project.org > Subject: [Qtwebengine] QWebEnginePage -- when is loadFinished() called? > > I'm creating a headless render engine, which serializes whenever loadFinished() > is signaled. Because of this, I'd like to understand the details of loadFinished(). > > There are many definitions of being "finished" when rendering a page, including: > 1. DOM has been downloaded > 2. DOM has been downloaded, resources specified in the original DOM (as > opposed to other scripts or iframes) have been rendered into the page (as used > in phantomjs http://phantomjs.org/api/webpage/handler/on-load- > finished.html) > 3. The global javascript variable "window" fires the "load" event (see > https://developer.mozilla.org/en-US/Add-ons/Code_snippets/On_page_load) > > For QWebEnginePage, is it correct to assume loadFinished() is signaled the same > as #2? If not, can anyone share their insights as to what conditions must be filled > for loadFinished() to signal? The loadFinished() signal is emitted in response to WebContentsObserver::DidFinishLoad. From it's in-source documentation: // This method is invoked when the navigation is done, i.e. the spinner of // the tab will stop spinning, and the onload event was dispatched. https://code.google.com/p/chromium/codesearch#chromium/src/content/public/browser/web_contents_observer.h&q=file:web_contents_observer.h%20function:DidFinishLoad&sq=package:chromium&l=197 So yeah, this should be 2. and 3. Regards Kai From knt261 at gmail.com Fri Nov 6 00:23:49 2015 From: knt261 at gmail.com (Kevin Truong) Date: Thu, 5 Nov 2015 15:23:49 -0800 Subject: [Qtwebengine] Execute javascript after QWebEnginePage is finished loading gives an error Message-ID: I'd like to run some javascript after a page has finished loading, but its giving a CanExecuteJavascript() error in Chromium. My code is pretty simple, here is my slot: void MyProject::myFunction(bool ok) { if (ok) { m_page.runJavaScript("document.body.innerHTML = 'Success!'); } } And then I simply did: QObject::connect(&m_page, SIGNAL(loadFinished(bool)), this, SLOT(myFunction(bool))); m_page.load(url); This is the error message I received: =================== [1105/151113:FATAL:render_frame_host_impl.cc(305)] Check failed: CanExecuteJavaScript(). #0 0x7f631facc67e #1 0x7f631fae331e #2 0x7f631e9aacb3 #3 0x7f631cee68c0 QtWebEngineCore::WebContentsAdapter::runJavaScript() #4 0x0000004030a7 Render::finishedLoading() #5 0x7f632227a36e QMetaObject::activate() #6 0x7f6322f963d2 QWebEnginePage::loadFinished() #7 0x7f6322f9780b #8 0x7f631ceeb26c #9 0x7f631ebd8a67 #10 0x7f631ebe1c13 #11 0x7f631e9b2983 #12 0x7f631eb0aa6e #13 0x7f631f6ce8b0 #14 0x7f631facdfd5 #15 0x7f631faea799 #16 0x7f631faeab91 #17 0x7f631faeb36b #18 0x7f631cebc5b3 #19 0x7f632227b3bb QObject::event() #20 0x7f63228554dc QApplicationPrivate::notify_helper() #21 0x7f632285a640 QApplication::notify() #22 0x7f632224c6a3 QCoreApplication::notifyInternal() #23 0x7f632224e913 QCoreApplicationPrivate::sendPostedEvents() #24 0x7f63222a16f3 #25 0x7f631ac5dc3d g_main_context_dispatch #26 0x7f631ac5df20 #27 0x7f631ac5dfcc g_main_context_iteration #28 0x7f63222a1ae7 QEventDispatcherGlib::processEvents() #29 0x7f632224a252 QEventLoop::exec() #30 0x7f6322251d3d QCoreApplication::exec() #31 0x00000040265d main #32 0x7f63216eca40 __libc_start_main #33 0x000000402799 _start Aborted (core dumped) =================== Note that I can call m_page.runJavaScript() and it won't throw an error if its called before the loadFinished() is signaled. Why is it that it throws an error when I call m_page.runJavaScript() after loadFinished() is signaled? And is there a way to run JavaScript after the page has finished loading? All the best, Kevin -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kai.Koehne at theqtcompany.com Fri Nov 6 10:21:37 2015 From: Kai.Koehne at theqtcompany.com (Koehne Kai) Date: Fri, 6 Nov 2015 09:21:37 +0000 Subject: [Qtwebengine] Execute javascript after QWebEnginePage is finished loading gives an error In-Reply-To: References: Message-ID: > -----Original Message----- > From: QtWebEngine [mailto:qtwebengine-bounces at qt-project.org] On Behalf > Of Kevin Truong > Sent: Friday, November 06, 2015 12:24 AM > To: qtwebengine at qt-project.org > Subject: [Qtwebengine] Execute javascript after QWebEnginePage is finished > loading gives an error > > I'd like to run some javascript after a page has finished loading, but its giving a > CanExecuteJavascript() error in Chromium. Which version is this? This is definitely supported. If you've playing with current dev, you might have hit https://bugreports.qt.io/browse/QTBUG-49235. . Fix is at https://codereview.qt-project.org/#/c/140040/ . Regards Kai From knt261 at gmail.com Fri Nov 6 22:41:21 2015 From: knt261 at gmail.com (Kevin Truong) Date: Fri, 6 Nov 2015 13:41:21 -0800 Subject: [Qtwebengine] Execute javascript after QWebEnginePage is finished loading gives an error In-Reply-To: References: Message-ID: Thanks Kai! The suggestion worked -- I just updated to the latest commit of webengine and reinstalled it. I was using the Nov 2nd revision before. On Fri, Nov 6, 2015 at 1:21 AM, Koehne Kai wrote: > > > > -----Original Message----- > > From: QtWebEngine [mailto:qtwebengine-bounces at qt-project.org] On Behalf > > Of Kevin Truong > > Sent: Friday, November 06, 2015 12:24 AM > > To: qtwebengine at qt-project.org > > Subject: [Qtwebengine] Execute javascript after QWebEnginePage is > finished > > loading gives an error > > > > I'd like to run some javascript after a page has finished loading, but > its giving a > > CanExecuteJavascript() error in Chromium. > > Which version is this? This is definitely supported. > > If you've playing with current dev, you might have hit > https://bugreports.qt.io/browse/QTBUG-49235. . Fix is at > https://codereview.qt-project.org/#/c/140040/ . > > Regards > > Kai > -------------- next part -------------- An HTML attachment was scrubbed... URL: From patricks17092012 at gmail.com Mon Nov 16 10:36:39 2015 From: patricks17092012 at gmail.com (patrick s) Date: Mon, 16 Nov 2015 10:36:39 +0100 Subject: [Qtwebengine] Flash in 5.6 beta In-Reply-To: References: Message-ID: Hi, there is now a 32bit beta package available (qt-opensource-windows-x86-msvc2013-5.6.0-beta_255.exe), but I still get the same result. The pepflashplayer file is present in the flash folder you mentioned, but it just says "could not load plugin" in place of where flash should be. Can anyone confirm that it is working with this package, so that I know if the error is on my side? Best regards, Patrick 2015-11-04 9:25 GMT+01:00 Bruning Michael : > Hi Patrick, > > > on Windows, we currently only support the pepper Flash player on x86 / > 32bit. > > The path that is searched is "C:/Windows/SysWOW64/Macromed/Flash/" and the > DLL containing the flash player has to follow the naming convention > "pepflashplayer*.dll" . > > > Best regards, > > Michael > > > > ------------------------------ > > * From:* QtWebEngine on behalf of > patrick s > *Sent:* Wednesday, November 4, 2015 08:52 > *To:* qtwebengine at qt-project.org > *Subject:* [Qtwebengine] Flash in 5.6 beta > > Hi everyone, > > i'm trying to get flash running with the 5.6 beta packages. It seems to > work fine on Linux, but on Windows I can't get it to work (msvc2013_64, > packages 198 and 241). > > When i do the check on https://helpx.adobe.com/flash-player.html it tells > me that flash is installed, but not enabled (with pluginsEnabled set to > true). It is working in chrome. > > Do i have to do anything else to get it running (use a specific flash > version or put the plugin in a specific location)? Or could there be > 64/32bit issues? Unfortunately there is no msvc2013_32 package (yet?) to > test this. > > Thanks in advance, > Patrick > > (sorry if anyone got this twice, I accidentally sent it first without > being subbed to the list) > -------------- next part -------------- An HTML attachment was scrubbed... URL: From knt261 at gmail.com Tue Nov 17 03:47:37 2015 From: knt261 at gmail.com (Kevin Truong) Date: Mon, 16 Nov 2015 18:47:37 -0800 Subject: [Qtwebengine] Any way to disable same-origin policy? Message-ID: Hi guys, I wrote a C++ class that utilizes QWebEnginePage. Towards the end of the process, I execute QWebEnginePage.runJavaScript(), which is a script that requires me to access the contents of iframes. Currently the javascript stops prematurely, which I am assuming is due to same-origin policy being enforced. Is there a way to disable this setting in QtWebEngine? I am looking for an option similar to this, which is a way to do it via command line for Chromium: http://stackoverflow.com/questions/3102819/disable-same-origin-policy-in-chrome But couldn't find a way to do this for QtWebEngine in C++ code after googling for a while. Any help would be appreciated, thanks! Best, Kevin -------------- next part -------------- An HTML attachment was scrubbed... URL: From knt261 at gmail.com Wed Nov 18 00:01:30 2015 From: knt261 at gmail.com (Kevin Truong) Date: Tue, 17 Nov 2015 15:01:30 -0800 Subject: [Qtwebengine] Any way to disable same-origin policy? In-Reply-To: References: Message-ID: (CC'ing the mailing list, hope you don't mind) Thanks Herman! Your response was clear and helpful. I think these options are meant to fix the problem, but even after enabling the options, my issue still persists for some reason. Here is an example code of what I have, and the output I see. Note that m_page is of type QWebEnginePage: m_page.settings()->globalSettings()->setAttribute(QWebEngineSettings::WebAttribute::LocalStorageEnabled, true); m_page.settings()->globalSettings()->setAttribute(QWebEngineSettings::WebAttribute::LocalContentCanAccessRemoteUrls, true); m_page.settings()->globalSettings()->setAttribute(QWebEngineSettings::WebAttribute::LocalContentCanAccessFileUrls, true); m_page.settings()->setAttribute(QWebEngineSettings::WebAttribute::LocalStorageEnabled, true); m_page.settings()->setAttribute(QWebEngineSettings::WebAttribute::LocalContentCanAccessRemoteUrls, true); m_page.settings()->setAttribute(QWebEngineSettings::WebAttribute::LocalContentCanAccessFileUrls, true); m_page.load(url); .... (loadFinished() is signaled) m_page.runJavaScript(m_script); The script tries to access the contents of an iframe in the page, but runs into this error: javaScriptConsoleMessage: ErrorMessage on https://www.redditstatic.com/reddit-init.en.2GOSboVBoYc.js:5: Client Error: "SecurityError: Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a frame with origin "https://www.reddit.com" from accessing a cross-origin frame." thrown at L132:25 in Message: "Uncaught SecurityError: Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a frame with origin "https://www.reddit.com" from accessing a cross-origin frame." javaScriptConsoleMessage: ErrorMessage on :132: Uncaught SecurityError: Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a frame with origin "https://www.reddit.com" from accessing a frame with origin "https://www.redditmedia.com". Protocols, domains, and ports must match. It seems like same-origin policy is still being enforced for some reason. Maybe I am disabling it incorrectly... Does anyone have any idea what I can do to fix this? Best, Kevin On Tue, Nov 17, 2015 at 1:39 AM, Herman van Hazendonk wrote: > Hi Kevin, > > We've been working quite extensively on QtWebEngine while migrating our > App Rendering back-end from QtWebKit to QtWebEngine in the past couple of > months for our LuneOS (Open webOS)-project. > > We ran into "Oct 29 18:21:41 mako LunaWebAppManager1520: WARNING: > 18:21:41.107: CONSOLE JS: XMLHttpRequest cannot load > https://api.twitter.com/oauth/request_token. No > 'Access-Control-Allow-Origin' header is present on the requested resource. > Origin 'file://' is therefore not allowed access. The response had HTTP > status code 400." for example. > > We solved this by enabling a setting for QtWebEngine: > > webView.settings.localContentCanAccessRemoteUrls = true; > > Our code example is at: > https://github.com/webOS-ports/luna-webappmanager/commit/1dd780e0c554e3a6ecdd08fcf9df59173dd939ee > > You can find documentation for this at: > http://doc.qt.io/qt-5/qml-qtwebengine-webenginesettings.html > > Hope this helps! > > Herman > > > > On 2015-11-17 03:47, Kevin Truong wrote: > >> Hi guys, >> >> I wrote a C++ class that utilizes QWebEnginePage. Towards the end of >> the process, I execute QWebEnginePage.runJavaScript(), which is a >> script that requires me to access the contents of iframes. Currently >> the javascript stops prematurely, which I am assuming is due to >> same-origin policy being enforced. Is there a way to disable this >> setting in QtWebEngine? >> >> I am looking for an option similar to this, which is a way to do it >> via command line for Chromium: >> >> http://stackoverflow.com/questions/3102819/disable-same-origin-policy-in-chrome >> [1] >> >> But couldn't find a way to do this for QtWebEngine in C++ code after >> googling for a while. Any help would be appreciated, thanks! >> >> Best, >> Kevin >> >> Links: >> ------ >> [1] >> >> http://stackoverflow.com/questions/3102819/disable-same-origin-policy-in-chrome >> >> _______________________________________________ >> QtWebEngine mailing list >> QtWebEngine at qt-project.org >> http://lists.qt-project.org/mailman/listinfo/qtwebengine >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From knt261 at gmail.com Wed Nov 18 00:06:10 2015 From: knt261 at gmail.com (Kevin Truong) Date: Tue, 17 Nov 2015 15:06:10 -0800 Subject: [Qtwebengine] Any way to disable same-origin policy? In-Reply-To: References: Message-ID: Forgot to mention, but in case it helps to clarify, the javascript console outputs the exact same error messages whether or not I enable or comment out these settings: m_page.settings()->globalSettings()->setAttribute(QWebEngineSettings::WebAttribute::LocalStorageEnabled, true); m_page.settings()->globalSettings()->setAttribute(QWebEngineSettings::WebAttribute::LocalContentCanAccessRemoteUrls, true); m_page.settings()->globalSettings()->setAttribute(QWebEngineSettings::WebAttribute::LocalContentCanAccessFileUrls, true); m_page.settings()->setAttribute(QWebEngineSettings::WebAttribute::LocalStorageEnabled, true); m_page.settings()->setAttribute(QWebEngineSettings::WebAttribute::LocalContentCanAccessRemoteUrls, true); m_page.settings()->setAttribute(QWebEngineSettings::WebAttribute::LocalContentCanAccessFileUrls, true); So it seems like changing the settings this way has no effect for me. On Tue, Nov 17, 2015 at 3:01 PM, Kevin Truong wrote: > (CC'ing the mailing list, hope you don't mind) > > Thanks Herman! Your response was clear and helpful. I think these options > are meant to fix the problem, but even after enabling the options, my issue > still persists for some reason. Here is an example code of what I have, and > the output I see. Note that m_page is of type QWebEnginePage: > > m_page.settings()->globalSettings()->setAttribute(QWebEngineSettings::WebAttribute::LocalStorageEnabled, true); > > m_page.settings()->globalSettings()->setAttribute(QWebEngineSettings::WebAttribute::LocalContentCanAccessRemoteUrls, true); > > m_page.settings()->globalSettings()->setAttribute(QWebEngineSettings::WebAttribute::LocalContentCanAccessFileUrls, true); > > m_page.settings()->setAttribute(QWebEngineSettings::WebAttribute::LocalStorageEnabled, true); > > m_page.settings()->setAttribute(QWebEngineSettings::WebAttribute::LocalContentCanAccessRemoteUrls, true); > > m_page.settings()->setAttribute(QWebEngineSettings::WebAttribute::LocalContentCanAccessFileUrls, true); > > m_page.load(url); > > .... (loadFinished() is signaled) > m_page.runJavaScript(m_script); > > The script tries to access the contents of an iframe in the page, but runs > into this error: > > javaScriptConsoleMessage: ErrorMessage on > https://www.redditstatic.com/reddit-init.en.2GOSboVBoYc.js:5: Client > Error: "SecurityError: Failed to read the 'contentDocument' property from > 'HTMLIFrameElement': Blocked a frame with origin "https://www.reddit.com" > from accessing a cross-origin frame." thrown at L132:25 in Message: > "Uncaught SecurityError: Failed to read the 'contentDocument' property from > 'HTMLIFrameElement': Blocked a frame with origin "https://www.reddit.com" > from accessing a cross-origin frame." > javaScriptConsoleMessage: ErrorMessage on :132: Uncaught SecurityError: > Failed to read the 'contentDocument' property from 'HTMLIFrameElement': > Blocked a frame with origin "https://www.reddit.com" from accessing a > frame with origin "https://www.redditmedia.com". Protocols, domains, and > ports must match. > > > > It seems like same-origin policy is still being enforced for some reason. > Maybe I am disabling it incorrectly... Does anyone have any idea what I can > do to fix this? > > Best, > Kevin > > > > > On Tue, Nov 17, 2015 at 1:39 AM, Herman van Hazendonk > wrote: > >> Hi Kevin, >> >> We've been working quite extensively on QtWebEngine while migrating our >> App Rendering back-end from QtWebKit to QtWebEngine in the past couple of >> months for our LuneOS (Open webOS)-project. >> >> We ran into "Oct 29 18:21:41 mako LunaWebAppManager1520: WARNING: >> 18:21:41.107: CONSOLE JS: XMLHttpRequest cannot load >> https://api.twitter.com/oauth/request_token. No >> 'Access-Control-Allow-Origin' header is present on the requested resource. >> Origin 'file://' is therefore not allowed access. The response had HTTP >> status code 400." for example. >> >> We solved this by enabling a setting for QtWebEngine: >> >> webView.settings.localContentCanAccessRemoteUrls = true; >> >> Our code example is at: >> https://github.com/webOS-ports/luna-webappmanager/commit/1dd780e0c554e3a6ecdd08fcf9df59173dd939ee >> >> You can find documentation for this at: >> http://doc.qt.io/qt-5/qml-qtwebengine-webenginesettings.html >> >> Hope this helps! >> >> Herman >> >> >> >> On 2015-11-17 03:47, Kevin Truong wrote: >> >>> Hi guys, >>> >>> I wrote a C++ class that utilizes QWebEnginePage. Towards the end of >>> the process, I execute QWebEnginePage.runJavaScript(), which is a >>> script that requires me to access the contents of iframes. Currently >>> the javascript stops prematurely, which I am assuming is due to >>> same-origin policy being enforced. Is there a way to disable this >>> setting in QtWebEngine? >>> >>> I am looking for an option similar to this, which is a way to do it >>> via command line for Chromium: >>> >>> http://stackoverflow.com/questions/3102819/disable-same-origin-policy-in-chrome >>> [1] >>> >>> But couldn't find a way to do this for QtWebEngine in C++ code after >>> googling for a while. Any help would be appreciated, thanks! >>> >>> Best, >>> Kevin >>> >>> Links: >>> ------ >>> [1] >>> >>> http://stackoverflow.com/questions/3102819/disable-same-origin-policy-in-chrome >>> >>> _______________________________________________ >>> QtWebEngine mailing list >>> QtWebEngine at qt-project.org >>> http://lists.qt-project.org/mailman/listinfo/qtwebengine >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidsz at inf.u-szeged.hu Wed Nov 18 05:29:21 2015 From: davidsz at inf.u-szeged.hu (davidsz) Date: Wed, 18 Nov 2015 05:29:21 +0100 Subject: [Qtwebengine] =?utf-8?q?Any_way_to_disable_same-origin_policy=3F?= In-Reply-To: References: Message-ID: Hi Kevin, have you tried to pass "--disable-web-security" argument to your QApplication? It delegates the command line switches to the Chromium backend, so basically it should work. Best regards, Szabolcs 2015-11-18 00:06 időpontban Kevin Truong ezt írta: > Forgot to mention, but in case it helps to clarify, the javascript > console outputs the exact same error messages whether or not I enable > or comment out these settings: > > m_page.settings()->globalSettings()->setAttribute(QWebEngineSettings::WebAttribute::LocalStorageEnabled, > true); > > m_page.settings()->globalSettings()->setAttribute(QWebEngineSettings::WebAttribute::LocalContentCanAccessRemoteUrls, > true); > > m_page.settings()->globalSettings()->setAttribute(QWebEngineSettings::WebAttribute::LocalContentCanAccessFileUrls, > true); > > m_page.settings()->setAttribute(QWebEngineSettings::WebAttribute::LocalStorageEnabled, > true); > > m_page.settings()->setAttribute(QWebEngineSettings::WebAttribute::LocalContentCanAccessRemoteUrls, > true); > > m_page.settings()->setAttribute(QWebEngineSettings::WebAttribute::LocalContentCanAccessFileUrls, > true); > > So it seems like changing the settings this way has no effect for me. > > On Tue, Nov 17, 2015 at 3:01 PM, Kevin Truong wrote: > > (CC'ing the mailing list, hope you don't mind) > > Thanks Herman! Your response was clear and helpful. I think these > options are meant to fix the problem, but even after enabling the > options, my issue still persists for some reason. Here is an example > code of what I have, and the output I see. Note that m_page is of type > QWebEnginePage: > > m_page.settings()->globalSettings()->setAttribute(QWebEngineSettings::WebAttribute::LocalStorageEnabled, > true); > > m_page.settings()->globalSettings()->setAttribute(QWebEngineSettings::WebAttribute::LocalContentCanAccessRemoteUrls, > true); > > m_page.settings()->globalSettings()->setAttribute(QWebEngineSettings::WebAttribute::LocalContentCanAccessFileUrls, > true); > > m_page.settings()->setAttribute(QWebEngineSettings::WebAttribute::LocalStorageEnabled, > true); > > m_page.settings()->setAttribute(QWebEngineSettings::WebAttribute::LocalContentCanAccessRemoteUrls, > true); > > m_page.settings()->setAttribute(QWebEngineSettings::WebAttribute::LocalContentCanAccessFileUrls, > true); > > m_page.load(url); > > .... (loadFinished() is signaled) m_page.runJavaScript(m_script); >         > The script tries to access the contents of an iframe in the page, but > runs into this error: > > javaScriptConsoleMessage: ErrorMessage on > https://www.redditstatic.com/reddit-init.en.2GOSboVBoYc.js:5 [1]: > Client Error: "SecurityError: Failed to read the 'contentDocument' > property from 'HTMLIFrameElement': Blocked a frame with origin > "https://www.reddit.com [2]" from accessing a cross-origin frame." > thrown at L132:25 in  Message: "Uncaught SecurityError: Failed to read > the 'contentDocument' property from 'HTMLIFrameElement': Blocked a > frame with origin "https://www.reddit.com [2]" from accessing a > cross-origin frame." > javaScriptConsoleMessage: ErrorMessage on :132: Uncaught SecurityError: > Failed to read the 'contentDocument' property from 'HTMLIFrameElement': > Blocked a frame with origin "https://www.reddit.com [2]" from accessing > a frame with origin "https://www.redditmedia.com [3]". Protocols, > domains, and ports must match. > > It seems like same-origin policy is still being enforced for some > reason. Maybe I am disabling it incorrectly... Does anyone have any > idea what I can do to fix this? > > Best, > Kevin > > On Tue, Nov 17, 2015 at 1:39 AM, Herman van Hazendonk > wrote: > Hi Kevin, > > We've been working quite extensively on QtWebEngine while migrating our > App Rendering back-end from QtWebKit to QtWebEngine in the past couple > of months for our LuneOS (Open webOS)-project. > > We ran into "Oct 29 18:21:41 mako LunaWebAppManager1520: WARNING: > 18:21:41.107: CONSOLE JS: XMLHttpRequest cannot load > https://api.twitter.com/oauth/request_token [4]. No > 'Access-Control-Allow-Origin' header is present on the requested > resource. Origin 'file://' is therefore not allowed access. The > response had HTTP status code 400." for example. > > We solved this by enabling a setting for QtWebEngine: > > webView.settings.localContentCanAccessRemoteUrls = true; > > Our code example is at: > https://github.com/webOS-ports/luna-webappmanager/commit/1dd780e0c554e3a6ecdd08fcf9df59173dd939ee > [5] > > You can find documentation for this at: > http://doc.qt.io/qt-5/qml-qtwebengine-webenginesettings.html [6] > > Hope this helps! > > Herman > > On 2015-11-17 03:47, Kevin Truong wrote: > Hi guys, > > I wrote a C++ class that utilizes QWebEnginePage. Towards the end of > the process, I execute QWebEnginePage.runJavaScript(), which is a > script that requires me to access the contents of iframes. Currently > the javascript stops prematurely, which I am assuming is due to > same-origin policy being enforced. Is there a way to disable this > setting in QtWebEngine? > > I am looking for an option similar to this, which is a way to do it > via command line for Chromium: > http://stackoverflow.com/questions/3102819/disable-same-origin-policy-in-chrome > [7] > [1] > > But couldn't find a way to do this for QtWebEngine in C++ code after > googling for a while. Any help would be appreciated, thanks! > > Best, > Kevin > > Links: > ------ > [1] > http://stackoverflow.com/questions/3102819/disable-same-origin-policy-in-chrome > [7] > > _______________________________________________ > QtWebEngine mailing list > QtWebEngine at qt-project.org > http://lists.qt-project.org/mailman/listinfo/qtwebengine [8] > > > > Links: > ------ > [1] https://www.redditstatic.com/reddit-init.en.2GOSboVBoYc.js:5 > [2] https://www.reddit.com > [3] https://www.redditmedia.com > [4] https://api.twitter.com/oauth/request_token > [5] > https://github.com/webOS-ports/luna-webappmanager/commit/1dd780e0c554e3a6ecdd08fcf9df59173dd939ee > [6] http://doc.qt.io/qt-5/qml-qtwebengine-webenginesettings.html > [7] > http://stackoverflow.com/questions/3102819/disable-same-origin-policy-in-chrome > [8] http://lists.qt-project.org/mailman/listinfo/qtwebengine > > _______________________________________________ > QtWebEngine mailing list > QtWebEngine at qt-project.org > http://lists.qt-project.org/mailman/listinfo/qtwebengine From Kai.Koehne at theqtcompany.com Wed Nov 18 09:21:24 2015 From: Kai.Koehne at theqtcompany.com (Koehne Kai) Date: Wed, 18 Nov 2015 08:21:24 +0000 Subject: [Qtwebengine] Any way to disable same-origin policy? In-Reply-To: References: Message-ID: > -----Original Message----- > From: QtWebEngine [mailto:qtwebengine-bounces at qt-project.org] On Behalf > Of Kevin Truong > Sent: Tuesday, November 17, 2015 3:48 AM > To: qtwebengine at qt-project.org > Subject: [Qtwebengine] Any way to disable same-origin policy? > > Hi guys, > > I wrote a C++ class that utilizes QWebEnginePage. Towards the end of the > process, I execute QWebEnginePage.runJavaScript(), which is a script that > requires me to access the contents of iframes. Currently the javascript stops > prematurely, which I am assuming is due to same-origin policy being enforced. Is > there a way to disable this setting in QtWebEngine? Maybe you can try out the QWebEngineScript api. This allows you To explicitly set whether you want to run on sub frames, or not: http://doc.qt.io/qt-5/qwebenginescript.html#setRunsOnSubFrames If that ain't help either, this is IMO a bug. Please create a request on bugreports.qt.io Regards Kai From Kai.Koehne at theqtcompany.com Wed Nov 18 12:27:26 2015 From: Kai.Koehne at theqtcompany.com (Koehne Kai) Date: Wed, 18 Nov 2015 11:27:26 +0000 Subject: [Qtwebengine] Flash in 5.6 beta In-Reply-To: References: Message-ID: > -----Original Message----- > From: QtWebEngine [mailto:qtwebengine-bounces at qt-project.org] On Behalf > Subject: Re: [Qtwebengine] Flash in 5.6 beta > > Hi, > > there is now a 32bit beta package available (qt-opensource-windows-x86- > msvc2013-5.6.0-beta_255.exe), but I still get the same result. The > pepflashplayer file is present in the flash folder you mentioned, but it just says > "could not load plugin" in place of where flash should be. Can anyone confirm > that it is working with this package, so that I know if the error is on my side? There's indeed a bug in loading the Pepper plugin on Windows at the default locations. https://codereview.qt-project.org/#/c/141260/ Thanks for the heads-up! Kai From patricks17092012 at gmail.com Wed Nov 18 16:22:31 2015 From: patricks17092012 at gmail.com (patrick s) Date: Wed, 18 Nov 2015 16:22:31 +0100 Subject: [Qtwebengine] Flash in 5.6 beta In-Reply-To: References: Message-ID: Awesome, I got it to work now! I'm pretty sure i tried to put the flash-plugin in the Qt library folder before, but apparently not in the actual working dir ;) Cheers, Patrick 2015-11-18 12:27 GMT+01:00 Koehne Kai : > > -----Original Message----- > > From: QtWebEngine [mailto:qtwebengine-bounces at qt-project.org] On Behalf > > Subject: Re: [Qtwebengine] Flash in 5.6 beta > > > > Hi, > > > > there is now a 32bit beta package available (qt-opensource-windows-x86- > > msvc2013-5.6.0-beta_255.exe), but I still get the same result. The > > pepflashplayer file is present in the flash folder you mentioned, but it > just says > > "could not load plugin" in place of where flash should be. Can anyone > confirm > > that it is working with this package, so that I know if the error is on > my side? > > There's indeed a bug in loading the Pepper plugin on Windows at the > default locations. > > https://codereview.qt-project.org/#/c/141260/ > > Thanks for the heads-up! > > Kai > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From knt261 at gmail.com Thu Nov 19 22:49:37 2015 From: knt261 at gmail.com (Kevin Truong) Date: Thu, 19 Nov 2015 13:49:37 -0800 Subject: [Qtwebengine] Any way to disable same-origin policy? In-Reply-To: References: Message-ID: Thank you for the responses! The issue is fixed now. On Tue, Nov 17, 2015 at 8:29 PM, davidsz wrote: > Hi Kevin, > > have you tried to pass "--disable-web-security" argument to your > QApplication? It delegates the command line switches to the Chromium > backend, so basically it should work. > > Best regards, > Szabolcs Szabolcs -- yes! That works. I'm new to Qt and did not know we can do such a thing, but same origin policy is now disabled :) On Wed, Nov 18, 2015 at 12:21 AM, Koehne Kai wrote: > > Maybe you can try out the QWebEngineScript api. This allows you > To explicitly set whether you want to run on sub frames, or not: > > http://doc.qt.io/qt-5/qwebenginescript.html#setRunsOnSubFrames > > If that ain't help either, this is IMO a bug. Please create a request on > bugreports.qt.io > > Regards > > Kai > Kai -- Although my issue is fixed, I'm still curious to try out your method. How do I use QWebEngineScript with the QWebEnginePage object that I have? For example, I tried to add the following code right after calling m_page->runJavascript(m_script): QWebEngineScriptCollection* scripts = &m_page->scripts(); QList scriptsList = scripts->toList(); for (int i = 0; i < scriptsList.size(); i++) { QWebEngineScript script = scriptsList.at(i); script.setRunsOnSubFrames(true); } But it doesn't seem to work (maybe the javascript is already finished running before I was able to iterate through all the script source and set runsOnSubFrames to true). Mind if you point me to the right direction/documentation? Best, Kevin -------------- next part -------------- An HTML attachment was scrubbed... URL: From knt261 at gmail.com Fri Nov 20 06:52:56 2015 From: knt261 at gmail.com (Kevin Truong) Date: Thu, 19 Nov 2015 21:52:56 -0800 Subject: [Qtwebengine] How to tell when DOM resources finishes downloading? Message-ID: I have a website that loads resources such as images, iframes, ajax, scripts, etc. Running qt web engine on this website, I found a way for the render to time the exact moment these requests were initiated by subclassing QWebEngineUrlRequestInterceptor, and passing that class to m_page.profile()->setRequestInterceptor(). However, I would also like to time when these DOM resources finish downloading as well. This was possible in qt webkit, so I was hoping there's a way to do it for qt webengine. One example I thought was the solution is the signal QWebEngineProfile::downloadRequested(QWebEngineDownloadItem *download). This signal allows me to access the QWebEngineDownloadItem object, which signals when the download has finished, which is basically what I am looking for. However, this signal doesn't ever seem to be executed. I think it is only run when e.g. a user clicks on a download link, rather than being run for every DOM resource being loaded. I spent basically the entire day looking through documentations, but couldn't find anything. Any help would be appreciated! Best, Kevin -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kai.Koehne at theqtcompany.com Fri Nov 20 08:55:03 2015 From: Kai.Koehne at theqtcompany.com (Koehne Kai) Date: Fri, 20 Nov 2015 07:55:03 +0000 Subject: [Qtwebengine] Any way to disable same-origin policy? In-Reply-To: References: Message-ID: > -----Original Message----- > From: Kevin Truong [mailto:knt261 at gmail.com] > [...] > Kai -- Although my issue is fixed, I'm still curious to try out your method. How do > I use QWebEngineScript with the QWebEnginePage object that I have? For > example, I tried to add the following code right after calling m_page- > >runJavascript(m_script): > > > > > QWebEngineScriptCollection* scripts = &m_page->scripts(); > QList scriptsList = scripts->toList(); > for (int i = 0; i < scriptsList.size(); i++) { > QWebEngineScript script = scriptsList.at(i); > script.setRunsOnSubFrames(true); > } > > > But it doesn't seem to work (maybe the javascript is already finished running > before I was able to iterate through all the script source and set > runsOnSubFrames to true). Mind if you point me to the right > direction/documentation? You've to replace the runJavaScript() call with a QWebEngineScript. So page.runJavascript(m_script); becomes e.g. QWebEngineScript script; script.setSourceCode(m_script); script.setInjectionPoint(QWebEngineScript::DocumentReady); script.setRunsOnSubFrames(true); page.scripts.insert(script); Note that you can't set a callback method in this API though. The relationship with runJavaScript() could be indeed better documented ... I'll have a look. Regards Kai From knt261 at gmail.com Fri Nov 20 23:53:33 2015 From: knt261 at gmail.com (Kevin Truong) Date: Fri, 20 Nov 2015 14:53:33 -0800 Subject: [Qtwebengine] Any way to disable same-origin policy? In-Reply-To: References: Message-ID: Thanks Kai, that was helpful! I would actually prefer to use this method if I can better control when to execute the script -- it seems like the injection points are very limited, tied to certain document events. On Thu, Nov 19, 2015 at 11:55 PM, Koehne Kai wrote: > > > > -----Original Message----- > > From: Kevin Truong [mailto:knt261 at gmail.com] > > [...] > > Kai -- Although my issue is fixed, I'm still curious to try out your > method. How do > > I use QWebEngineScript with the QWebEnginePage object that I have? For > > example, I tried to add the following code right after calling m_page- > > >runJavascript(m_script): > > > > > > > > > > QWebEngineScriptCollection* scripts = &m_page->scripts(); > > QList scriptsList = scripts->toList(); > > for (int i = 0; i < scriptsList.size(); i++) { > > QWebEngineScript script = scriptsList.at(i); > > script.setRunsOnSubFrames(true); > > } > > > > > > But it doesn't seem to work (maybe the javascript is already finished > running > > before I was able to iterate through all the script source and set > > runsOnSubFrames to true). Mind if you point me to the right > > direction/documentation? > > You've to replace the runJavaScript() call with a QWebEngineScript. > > So > > page.runJavascript(m_script); > > becomes e.g. > > QWebEngineScript script; > script.setSourceCode(m_script); > script.setInjectionPoint(QWebEngineScript::DocumentReady); > script.setRunsOnSubFrames(true); > page.scripts.insert(script); > > Note that you can't set a callback method in this API though. > > The relationship with runJavaScript() could be indeed better documented > ... I'll have a look. > > Regards > > Kai > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kai.Koehne at theqtcompany.com Sat Nov 21 10:20:28 2015 From: Kai.Koehne at theqtcompany.com (Koehne Kai) Date: Sat, 21 Nov 2015 09:20:28 +0000 Subject: [Qtwebengine] Any way to disable same-origin policy? In-Reply-To: References: Message-ID: > -----Ursprüngliche Nachricht----- > Von: Kevin Truong [mailto:knt261 at gmail.com] > Gesendet: Freitag, 20. November 2015 23:54 > An: Koehne Kai > Cc: qtwebengine at qt-project.org > Betreff: Re: [Qtwebengine] Any way to disable same-origin policy? > > Thanks Kai, that was helpful! I would actually prefer to use this method if I > can better control when to execute the script -- it seems like the injection > points are very limited, tied to certain document events. It's true that the injection points are limited. That doesn't mean that you can't hook up things in your injected code though so that things are executed at the right time: If you want to execute JavaScript triggered by events in the page itself you can use the standard hooks to do so. If you want to execute JavaScript triggered by events in your C++ application, you can set up a QWebChannel has a bi-directional communication channel. You can expose a Q_OBJECT in this channel, and then hook up JavaScript methods as soon as a signal is emitted/a value in the object is changed. Hope this helps, Kai From 377307289 at qq.com Sun Nov 22 06:42:19 2015 From: 377307289 at qq.com (=?ISO-8859-1?B?TmVtbw==?=) Date: Sun, 22 Nov 2015 13:42:19 +0800 Subject: [Qtwebengine] How to get real html source in page with ajax? Message-ID: I use webengine to view youtube page, scroll the page to bottom and see the comment which use ajax, than I use view->page()->toHtml(***) to get html source, but I found that there is no ajax part (the comment) in html source. How can I get real html source in page with ajax? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kai.Koehne at theqtcompany.com Mon Nov 23 08:59:10 2015 From: Kai.Koehne at theqtcompany.com (Koehne Kai) Date: Mon, 23 Nov 2015 07:59:10 +0000 Subject: [Qtwebengine] How to tell when DOM resources finishes downloading? In-Reply-To: References: Message-ID: > -----Original Message----- > From: QtWebEngine [mailto:qtwebengine-bounces at qt-project.org] On Behalf > Of Kevin Truong > Sent: Friday, November 20, 2015 6:53 AM > To: qtwebengine at qt-project.org > Subject: [Qtwebengine] How to tell when DOM resources finishes downloading? > > I have a website that loads resources such as images, iframes, ajax, scripts, etc. > > Running qt web engine on this website, I found a way for the render to time the > exact moment these requests were initiated by subclassing > QWebEngineUrlRequestInterceptor, and passing that class to m_page.profile()- > >setRequestInterceptor(). > > However, I would also like to time when these DOM resources finish > downloading as well. This was possible in qt webkit, so I was hoping there's a > way to do it for qt webengine. If you could explain your use case it might be easier to give you advice. I understood you already looked into QWebEngineView::loadFinished(), but you couldn't use it for some reason? > One example I thought was the solution is the signal > QWebEngineProfile::downloadRequested(QWebEngineDownloadItem > *download). This signal allows me to access the QWebEngineDownloadItem > object, which signals when the download has finished, which is basically what I > am looking for. However, this signal doesn't ever seem to be executed. I think it > is only run when e.g. a user clicks on a download link, rather than being run for > every DOM resource being loaded. downloadRequested() is only emitted basically for things that the user wants to explicitly save on disk (something that will show up in a browser's download manager). So I don’t think you can use that to profile the DOM progress. Regards Kai From patricks17092012 at gmail.com Tue Nov 3 14:10:27 2015 From: patricks17092012 at gmail.com (patrick s) Date: Tue, 03 Nov 2015 13:10:27 -0000 Subject: [Qtwebengine] Flash in 5.6 beta Message-ID: Hi everyone, i'm trying to get flash running with the 5.6 beta packages. It seems to work fine on Linux, but on Windows I can't get it to work (msvc2013_64, packages 198 and 241). When i do the check on https://helpx.adobe.com/flash-player.html it tells me that flash is installed, but not enabled (with pluginsEnabled set to true). It is working in chrome. Do i have to do anything else to get it running (use a specific flash version or put the plugin in a specific location)? Or could there be 64/32bit issues? Unfortunately there is no msvc2013_32 package (yet?) to test this. Thanks in advance, Patrick -------------- next part -------------- An HTML attachment was scrubbed... URL: From vavilon_kon at mail.ru Thu Nov 12 11:14:36 2015 From: vavilon_kon at mail.ru (=?UTF-8?B?0JHQvtCz0LTQsNC9INCc0LXQu9GM0L3QuNC60L7Qsg==?=) Date: Thu, 12 Nov 2015 13:14:36 +0300 Subject: [Qtwebengine] =?utf-8?q?QTWEBENGINE=5FPLUGINS?= Message-ID: <1447323276.410849431@f352.i.mail.ru> Hi. I make the "browser" example from webenginewidgets and try to open page with swf plugin. But swf do not loaded. Is there a way to use or make or run my QWebEngine project with shockwave-plugin ability? -- Bogdan Melnikov -------------- next part -------------- An HTML attachment was scrubbed... URL: From knt261 at gmail.com Tue Nov 24 19:14:46 2015 From: knt261 at gmail.com (Kevin Truong) Date: Tue, 24 Nov 2015 10:14:46 -0800 Subject: [Qtwebengine] How to tell when DOM resources finishes downloading? In-Reply-To: References: Message-ID: Sure Kai -- here's my use case: I have a page that loads ajax data into the document. The ajax gets loaded into the DOM much later than when the DomContentLoaded and the Load event is triggered (the red and blue vertical lines in the picture under "Network Panel Overview" https://developer.chrome.com/devtools/docs/network). If I understood correctly, it means the ajax is loaded much later than when loadFinished() is signaled as well. The amount of time we have to wait before the ajax is loaded into the document is variable -- it can take 50ms, or it can take up to 10 seconds. I would like to know exactly when the ajax is loaded into the DOM (or if that's not possible, exactly when the render finish downloading the ajax) before serializing/downloading the HTML of the page and doing tests on the HTML. This is because the HTML changes after the ajax is loaded into the DOM, and the tests need to be run on the updated HTML, not the initial HTML. I'd like this to be generalized as well (not just ajax, but any other DOM resource), because I have test pages where the exact same thing happens, but with iframes instead of ajax, or with certain very specific plug-ins (like the facebook posts that load below an article page). These resources load independently of DomContentLoaded and the Load event. However, I can identify them either via the URL or the content type -- I just need to figure out how I can tell the render to serialize only right after these resources are loaded. On Sun, Nov 22, 2015 at 11:59 PM, Koehne Kai wrote: > > > > -----Original Message----- > > From: QtWebEngine [mailto:qtwebengine-bounces at qt-project.org] On Behalf > > Of Kevin Truong > > Sent: Friday, November 20, 2015 6:53 AM > > To: qtwebengine at qt-project.org > > Subject: [Qtwebengine] How to tell when DOM resources finishes > downloading? > > > > I have a website that loads resources such as images, iframes, ajax, > scripts, etc. > > > > Running qt web engine on this website, I found a way for the render to > time the > > exact moment these requests were initiated by subclassing > > QWebEngineUrlRequestInterceptor, and passing that class to > m_page.profile()- > > >setRequestInterceptor(). > > > > However, I would also like to time when these DOM resources finish > > downloading as well. This was possible in qt webkit, so I was hoping > there's a > > way to do it for qt webengine. > > If you could explain your use case it might be easier to give you advice. > > I understood you already looked into QWebEngineView::loadFinished(), > but you couldn't use it for some reason? > > > One example I thought was the solution is the signal > > QWebEngineProfile::downloadRequested(QWebEngineDownloadItem > > *download). This signal allows me to access the QWebEngineDownloadItem > > object, which signals when the download has finished, which is basically > what I > > am looking for. However, this signal doesn't ever seem to be executed. I > think it > > is only run when e.g. a user clicks on a download link, rather than > being run for > > every DOM resource being loaded. > > downloadRequested() is only emitted basically for things that the user > wants > to explicitly save on disk (something that will show up in a browser's > download > manager). So I don’t think you can use that to profile the DOM progress. > > Regards > > Kai > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kai.Koehne at theqtcompany.com Wed Nov 25 09:14:38 2015 From: Kai.Koehne at theqtcompany.com (Koehne Kai) Date: Wed, 25 Nov 2015 08:14:38 +0000 Subject: [Qtwebengine] How to tell when DOM resources finishes downloading? In-Reply-To: References: Message-ID: > -----Original Message----- > From: Kevin Truong [mailto:knt261 at gmail.com] > Sent: Tuesday, November 24, 2015 7:15 PM > To: Koehne Kai > Cc: qtwebengine at qt-project.org > Subject: Re: [Qtwebengine] How to tell when DOM resources finishes > downloading? > > Sure Kai -- here's my use case: I have a page that loads ajax data into the > document. The ajax gets loaded into the DOM much later than when the > DomContentLoaded and the Load event is triggered (the red and blue vertical > lines in the picture under "Network Panel Overview" > https://developer.chrome.com/devtools/docs/network). If I understood > correctly, it means the ajax is loaded much later than when loadFinished() is > signaled as well. The amount of time we have to wait before the ajax is loaded > into the document is variable -- it can take 50ms, or it can take up to 10 seconds. > I would like to know exactly when the ajax is loaded into the DOM (or if that's > not possible, exactly when the render finish downloading the ajax) before > serializing/downloading the HTML of the page and doing tests on the HTML. This > is because the HTML changes after the ajax is loaded into the DOM, and the > tests need to be run on the updated HTML, not the initial HTML. I see. If you know the HTML/AJAX of the specific page, you might be able to hook up a JS handler that is called when the AJAX request is done, and then signal this to the C++ world , e.g. via QWebChannel. > I'd like this to be generalized as well (not just ajax, but any other DOM resource), > because I have test pages where the exact same thing happens, but with iframes > instead of ajax, or with certain very specific plug-ins (like the facebook posts > that load below an article page). These resources load independently of > DomContentLoaded and the Load event. However, I can identify them either via > the URL or the content type -- I just need to figure out how I can tell the render > to serialize only right after these resources are loaded. I'm afraid that's not possible right now in the general case. In Qt 5.6 we'll add QWebEngineUrlRequestInterceptor: http://doc-snapshots.qt.io/qt5-5.6/qwebengineurlrequestinterceptor.html But that is called _before_ the request hits the networking stack. But even if you would have a way to get notified when the network request is done, it doesn't mean that the page is re-rendered/the DOM being updated. Regards Kai From Kai.Koehne at theqtcompany.com Wed Nov 25 09:16:43 2015 From: Kai.Koehne at theqtcompany.com (Koehne Kai) Date: Wed, 25 Nov 2015 08:16:43 +0000 Subject: [Qtwebengine] QTWEBENGINE_PLUGINS In-Reply-To: <1447323276.410849431@f352.i.mail.ru> References: <1447323276.410849431@f352.i.mail.ru> Message-ID: > -----Original Message----- > From: QtWebEngine [mailto:qtwebengine-bounces at qt-project.org] On Behalf > Of Богдан Мельников > Sent: Thursday, November 12, 2015 11:15 AM > To: qtwebengine at qt-project.org > Subject: [Qtwebengine] QTWEBENGINE_PLUGINS > > Hi. I make the "browser" example from webenginewidgets and try to open page > with swf plugin. But swf do not loaded. Is there a way to use or make or run my > QWebEngine project with shockwave-plugin ability? We'll support loading a Flash plugin from some well-known locations in 5.6. Some caveats: - Flash plugin must be using the PPAPI (Pepper Plugin API) - On Windows, only 32 bit is supported Regards Kai From Kai.Koehne at theqtcompany.com Wed Nov 25 09:24:39 2015 From: Kai.Koehne at theqtcompany.com (Koehne Kai) Date: Wed, 25 Nov 2015 08:24:39 +0000 Subject: [Qtwebengine] Flash in 5.6 beta In-Reply-To: References: Message-ID: > -----Original Message----- > From: QtWebEngine [mailto:qtwebengine-bounces at qt-project.org] On Behalf > Of patrick s > Sent: Tuesday, November 03, 2015 2:10 PM > To: qtwebengine at qt-project.org > Subject: [Qtwebengine] Flash in 5.6 beta > > Hi everyone, > > i'm trying to get flash running with the 5.6 beta packages. It seems to work fine > on Linux, but on Windows I can't get it to work (msvc2013_64, packages 198 > and 241). > > When i do the check on https://helpx.adobe.com/flash-player.html it tells me > that flash is installed, but not enabled (with pluginsEnabled set to true). It is > working in chrome. > > Do i have to do anything else to get it running (use a specific flash version or put > the plugin in a specific location)? Or could there be 64/32bit issues? Right now we only try to load Flash from the 'standard' location if it's a 32 bit build: C:/Windows/SysWOW64/Macromed/Flash I'm not sure whether there's a general problem with 64 bit , or whether we just haven't tested this one yet. > Unfortunately there is no msvc2013_32 package (yet?) to test this. Don't worry, there will be 32 bit packages for the Beta, too. Regards Kai > Thanks in advance, > Patrick From Kai.Koehne at theqtcompany.com Wed Nov 25 09:32:43 2015 From: Kai.Koehne at theqtcompany.com (Koehne Kai) Date: Wed, 25 Nov 2015 08:32:43 +0000 Subject: [Qtwebengine] Flash in 5.6 beta In-Reply-To: References: Message-ID: Just noticed that https://codereview.qt-project.org/#/c/141260/ hasn't merged yet. So you need to cherry-pick this if you want to experiment with Flash support for Windows for the time being. Regards Kai > > -----Original Message----- > > From: QtWebEngine [mailto:qtwebengine-bounces at qt-project.org] On > > Behalf Of patrick s > > Sent: Tuesday, November 03, 2015 2:10 PM > > To: qtwebengine at qt-project.org > > Subject: [Qtwebengine] Flash in 5.6 beta > > > > Hi everyone, > > > > i'm trying to get flash running with the 5.6 beta packages. It seems > > to work fine on Linux, but on Windows I can't get it to work > > (msvc2013_64, packages 198 and 241). > > > > When i do the check on https://helpx.adobe.com/flash-player.html it > > tells me that flash is installed, but not enabled (with pluginsEnabled > > set to true). It is working in chrome. > > > > Do i have to do anything else to get it running (use a specific flash > > version or put the plugin in a specific location)? Or could there be 64/32bit > issues? > > Right now we only try to load Flash from the 'standard' location if it's a 32 bit > build: > > C:/Windows/SysWOW64/Macromed/Flash > > I'm not sure whether there's a general problem with 64 bit , or whether we just > haven't tested this one yet. > > > Unfortunately there is no msvc2013_32 package (yet?) to test this. > > Don't worry, there will be 32 bit packages for the Beta, too. > > Regards > > Kai > > > Thanks in advance, > > Patrick > > _______________________________________________ > QtWebEngine mailing list > QtWebEngine at qt-project.org > http://lists.qt-project.org/mailman/listinfo/qtwebengine From jp.kuraisu at gmail.com Mon Nov 30 16:01:27 2015 From: jp.kuraisu at gmail.com (Aleksey Yermakov) Date: Mon, 30 Nov 2015 18:01:27 +0300 Subject: [Qtwebengine] ApplicationCache in QtWebEngine Message-ID: Hi, I'm in a process of porting a Qt application from QtWebkit to QtWebEngine and I have encountered a strange problem with application cache. Page, manifest and resources from manifest are all loading fine, but when server goes offline, QtWebEngine doesn't serve this resources from application cache and instead shows loading error. You can find simple test application with simple server attached here: https://github.com/Kuraisu/qtwebengine-appcache-test Any help would be much appreciated as I'm currently not sure how I should proceed with this. Cheers, Aleksey -- Aleksey Yermakov -------------- next part -------------- An HTML attachment was scrubbed... URL: From Mattias.Sahlen at qmatic.com Mon Nov 30 10:59:28 2015 From: Mattias.Sahlen at qmatic.com (Mattias Sahlen) Date: Mon, 30 Nov 2015 09:59:28 +0000 Subject: [Qtwebengine] Memory leak in QtWebengine 5.6? Message-ID: <1448877568284.32629@qmatic.com> Hello, Our application is based on a QML WebEngineView, displaying a single page. After about 5 days our app crashes with this error message: [1121/191421:FATAL:memory_linux.cc(42)] Out of memory, size = 1 qml: Webengine render process exited with code 6 (killed), exiting! (this is from our code, catching onRenderProcessTerminated) We have logged the memory usage and when this occurs, there is about 700 MB memory left on the system. After approximately 4 days there is a sudden spike in memory usage from 300 MB to 500 MB. We are running on an IMX6 platform if it makes any difference. Attaching a plot of the memory usage. Any ideas what could be going on? Any input appreciated, /Mattias? -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: plot_quad_2gb_2.png Type: image/png Size: 57736 bytes Desc: plot_quad_2gb_2.png URL: