I know that we are able to change useragent string by setting key general.browser.useragent.override
but how can I get current useragent string when it's not available through nsIPrefService ?
The userAgent property on nsIHttpProtocolHandler should give this to you. http://hg.mozilla.org/mozilla-central/file/ddaf5686c70c/services/sync/modules/service.js#l378 shows a typical usage.
That's assuming you're in a JS component. If you're running in a Window object, just use navigator.userAgent.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With