ohos: Implement httpUserAgentString in the WebView backend
The setter uses the native WebviewController.setCustomUserAgent(), which
is the only API that changes the real user agent (the outgoing HTTP
"User-Agent" header and navigator.userAgent on the next load).
Overriding navigator.userAgent from page script (e.g. via
Object.defineProperty()) is not used: it only changes the value
JavaScript reads in the current document, leaves the HTTP header
untouched, and is reset on every navigation, so it would not satisfy the
property contract ("the user agent in use, the user-agent string sent
with HTTP").
The getter reads navigator.userAgent through the synchronous JS thread
gateway, returning the effective UA actually in use, as required by the
property contract. The native WebviewController.getUserAgent() is
intentionally not used for the getter: it returns the default UA and
ignores setCustomUserAgent(), so it would misreport the UA once a custom
one is set.
Task-number: QTBUG-146838
Pick-to: 6.12
Change-Id: I8dc0feaa833b1bdd74cd90ec7562c131006caadb
Reviewed-by: Zbigniew Chyla <zbigniew.chyla@qt.io>
Reviewed-by: SanthoshKumar Selvaraj <santhosh.kumar.selvaraj@qt.io>