Details
-
Bug
-
Resolution: Won't Do
-
Not Evaluated
-
None
-
5.15.11
-
None
Description
Currently, calling QWebEngineProfile::setHttpUserAgent forces a reload of the website. This would appear to be desired behavior, but there are times when the user agent needs to be changed without forcing a reload. For example, I sometimes need to change the user agent based on the URL that is being loaded. To do this, I inspect changes using a UrlRequestInterceptor. If it is changing in a way that needs a different user agent, I set the new one using setHttpUserAgent. However, this currently causes the WebEngine to reload the old URL, which interrupts the loading of the new URL.
It would seem that the best way to handle this is for setHttpUserAgent to change the user agent that will be used for future requests but not force a reload, leaving that up to the discretion of the programmer. Alternatively, the method could accept a boolean indicating if a reload should be automatically initiated after the user agent is changed.