Solved add header to WebView requests
-
Hi.
i need to set a header to each WebView request.
i was searching the forum, but did not find a solution for this.
setting a
QQmlNetworkAccessManagerFactory
does not work, theQQmlNetworkAccessManagerFactory::create
function is never called. seems like WebView does not useQNetworkAccessManager
?is this possible at all?
thanks for any hints.
-
@i.n.g.o. said in add header to WebView requests:
seems like WebView does not use QNetworkAccessManager?
on what platform are you on?
Anyway your changes are low from within QML. -
i need it to run on android and ios.
but also on desktop macos it is the same.
i am trying with Qt 5.12.2 right now. -
@i.n.g.o. said in add header to WebView requests:
i am trying with Qt 5.12.2 right now.
on mobile platforms the native webview is displayed (over the QML content). No chance to intercept the requests, for security reasons.
As i said, QML is not involved andQQmlNetworkAccessManagerFactory
is used for loading QML resources.Your only chance would be on Desktop to use QWebEngineHttpRequest
-
thank you for the explanation.