[webkit-qt] patching QtNetworkAccessManager::createRequest

Olivier Tilloy olivier at tilloy.net
Thu Oct 17 08:27:13 PDT 2013


Hi all,

I’m looking into patching QtNetworkAccessManager::createRequest(…) to 
dynamically set a custom user agent on every outgoing HTTP request 
(setting the experimental.userAgent property on the QML webview is not 
enough, I need per-domain overrides).

I know that with the multi-process architecture the qnam cannot be 
easily replaced on the application side, and I’m fine with having to 
minimally patch QtWebKit to achieve my goal (although of course being 
able to set a custom qnam at runtime would be ideal!).

I’m wondering how feasible it would be to have a signal emitted on the 
webview from createRequest(…) so that I can easily override the UA 
header dynamically, something similar to the onNavigationRequested 
signal, and how I would go about implementing such a hook?

Any help/pointers/suggestions of an alternative approach much appreciated!

Cheers,

  Olivier


More information about the webkit-qt mailing list