Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Contributor
Posts: 15
Registered: ‎02-13-2013
My Device: Dev Alpha B

How to implement User Agent in BB 10 Webworks

Hai, I'm Denny

 

I'm trying develop an app and use User Agent. Can someone help me, how to implement the user agent by code, an example code I think.

 

Thank's before

Developer
Posts: 435
Registered: ‎09-20-2011
My Device: Z10 LE, Playbook, DevAlpha C, 9900, 9380

Re: How to implement User Agent in BB 10 Webworks

to get the user agent.... u can use the code below

var useragent = navigator.userAgent;

for more
http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/How-to-detect-the-BlackBerry-Bro...
Retired
Posts: 245
Registered: ‎09-21-2012
My Device: Q10

Re: How to implement User Agent in BB 10 Webworks

You can also set it in your config file as follows:

 

<widget.......

.....

rim:userAgent="The custom user agent you want to set"

...>

</widget>

 

Docs for it are here: https://developer.blackberry.com/html5/documentation/widget_element_834671_11.html

 

@erikjohnzon
erjohnson@blackberry.com