Closed Bug 1512997 Opened 10 months ago Closed 8 months ago
Provide synchronous API to retrieve user agent string
47 bytes, text/x-phabricator-request
|Details | Review|
We've just added support for getting and setting the user agent string to our engine-gecko module in Android components. This makes use of the override setting introduced in https://bugzilla.mozilla.org/show_bug.cgi?id=1507369. However, there's one use case we can't cover with this. We want to provide a way to read the engine default user agent string if none was set by the application. This is used by applications like Firefox for Fire TV to parse the existing value and customize it on startup: https://github.com/mozilla-mobile/firefox-tv/blob/00b61b4f5344eb878b0efa4cafb61d535f1b9bc3/app/src/main/java/org/mozilla/tv/firefox/webrender/UserAgent.kt#L58 The existing API (GeckoSession#getUserAgent) is asynchronous and requires a session to be initialized, which isn't practical in this case. After taking to snorp it might be feasible to add a static value / method to retrieve the default setting?
Fenix and Fire TV want this.
Attachment #9045364 - Attachment is obsolete: true
Attachment #9043935 - Attachment description: Bug 1512997 - Add GeckoSession.getDefaultUserAgent API. #geckoview-reviewers!,nalexander! → Bug 1512997 - Add GeckoSession.getDefaultUserAgent API.
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/autoland/rev/4e46fb46408d Add GeckoSession.getDefaultUserAgent API. r=nalexander,rbarker
You need to log in before you can comment on or make changes to this bug.