[Qtwebengine] Any way to disable same-origin policy?

Koehne Kai Kai.Koehne at theqtcompany.com
Wed Nov 18 09:21:24 CET 2015



> -----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


More information about the QtWebEngine mailing list