[Qtwebengine] Modifying request Headers for QML's WebEngineView

Neil Williams neil+qt at copycopy.cc
Tue May 24 12:53:42 CEST 2016

Hi Michael,

Thanks for the response.

I am aware of those classes but as far as I know QML's WebEngineView does
not provide any way to get the underlying QWebEngine (if there is one at
all?) which means we would still be looking at mixing the native QWebEngine
with QQuickWidgets which is what we are trying to move away from.


On Tue, May 24, 2016 at 11:30 AM, Michael Bruning <Michael.Bruning at qt.io>

> Hi Neil,
> at the moment, we provide the option to set request headers via the Core
> APIs QWebEngineUrlRequestInterceptor (
> http://doc.qt.io/qt-5/qwebengineurlrequestinterceptor.html), which can be
> used to manipulate the request headers using
> QWebEngineUrlRequestInfo::setHttpHeader (
> http://doc.qt.io/qt-5/qwebengineurlrequestinfo.html#setHttpHeader) .
> While these are C++ APIs, it should be possible to use them with an
> application that uses QML to display the UI.
> I am not sure if that would fit the needs you have.
> Best regards,
> Michael
> ------------------------------
> *From:* QtWebEngine <qtwebengine-bounces+michael.bruning=
> qt.io at qt-project.org> on behalf of Neil Williams <neil+qt at copycopy.cc>
> *Sent:* Tuesday, May 24, 2016 12:06 PM
> *To:* qtwebengine at qt-project.org
> *Subject:* [Qtwebengine] Modifying request Headers for QML's WebEngineView
> Are there any plans to allow modifying of a request header's, or intercept
> requests via the QML WebEngineView component?
> We have a c++ backend with a qml frontend, occasionally we need to display
> web content within the App authenticated by the request headers (cookies +
> others). At the moment we have to use QtWebKit (waiting to see if
> QWebEngine can be submitted to the mac store in 5.7) and swap it around
> within a QStackedWidget with a Qml Widget. This obviously forces our hand
> in terms of how our app is composed and it is not ideal.
> I am aware that we won't be able to hook QNAM into QWebEngine ever, but
> allowing more control of the requests that originate from WebEngineView
> would do for now.
> Thanks.
> _______________________________________________
> QtWebEngine mailing list
> QtWebEngine at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/qtwebengine
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qtwebengine/attachments/20160524/fcc63bb2/attachment.html>

More information about the QtWebEngine mailing list