-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.8.3, 6.9.2
-
None
When a service worker sends an HTTP request or when accessing navigator.userAgent the default Qt user agent is used instead of the one set by the user with QWebEngineProfile::setHttpUserAgent()
Client hints seems to also behave the same, always using default values instead of the one set by the user.
To reproduce:
- Take simple browser demo
- Add m_profile->setHttpUserAgent("foobar"); to Browser::createHiddenWindow(bool offTheRecord)
- Run simplebrowser
- Go to youtube.com
- Open dev tools
- Open the console and type navigator.userAgent, check that the value is "foobar"
- Change the context of the console to "sw.js" using the combobox in the toolbar of the console
- Type navigator.userAgent, the value is Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/6.9.2 Chrome/130.0.0.0 Safari/537.36 instead of foobar