0
votes

I'm working on an app for Blackberry 6 and 7 using Webworks. I was wondering if it is possible to change the Navigator's user agent.

What I'd like to do is, add a string at the end. For instance:

Default: "Mozilla/5.0 (BB7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.149 Safari/537.36" Mine: "Mozilla/5.0 (BB7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.149 Safari/537.36 CustomText"

Thanks in advance!

1

1 Answers

0
votes

the easiest way is to modify your config.xml and add the rim:userAgent attribute in your widget element. You can find an explanation and example at https://developer.blackberry.com/html5/documentation/v1_0/widget_element_834671_11.html

<widget xmlns="http://www.w3.org/ns/widgets"
    xmlns:rim="http://www.blackberry.com/ns/widgets"
    version="2.0.0.0"
    id="sampleapp"
    rim:header="RIM-Widget:rim/widget"
    rim:userAgent="BlackBerry10/MyWebWorksApp">