This is a migrated thread and some comments may be shown as answers.

simulator user agent string is always iPhone

7 Answers 461 Views
General Discussion
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
bitbonk
Top achievements
Rank 1
bitbonk asked on 24 May 2013, 08:01 PM
The user agent string in the simulator of icenium is always

Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A537a Safari/419.3

I doesn't matter what device type I choose. Is this a known bug?

7 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 27 May 2013, 12:07 PM
Hi,

Do you refer to the user agent header that is being sent from the Graphite simulator? If this is the case, then this is a known limitation and we have a task to address it, but would appreciate if you share your real word scenario that requires this to work in our simulator.

Regards,
Steve
Telerik

Don't miss the Icenium May Release Keynote - sign up now!
Share feedback and vote for features on our Feedback Portal.
0
bitbonk
Top achievements
Rank 1
answered on 27 May 2013, 01:43 PM
Yes I am referring to the user agent header that is being sent from the Graphite simulator. We are planning to use this agent string to switch to the correct theme that matches the OS. It would be great if we could test these themes in the simulator. The themes are a combination of custom CSS and custom JavaScript (no 3rd party UI framework is involved here).
0
Steve
Telerik team
answered on 27 May 2013, 03:21 PM
Hi,

The user agent is successfully replaced in the simulator itself, you can see the following short video that shows this.

Regards,
Steve
Telerik

Don't miss the Icenium May Release Keynote - sign up now!
Share feedback and vote for features on our Feedback Portal.
0
bitbonk
Top achievements
Rank 1
answered on 27 May 2013, 04:06 PM
That's odd, it doesn't seem to work for me, with this simple index.html:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <title>Hello, World</title>
        <script src="jquery-mobile/jquery-1.8.2.min.js" type="text/javascript"></script>
    </head>
    <body>
        <script type="text/javascript">
            $(function(){ document.write(navigator.userAgent); });
        </script>
    </body>
</html>

Could it be that you set/override the user agent string at a later event than document ready (e.g. device ready)?
0
Steve
Telerik team
answered on 28 May 2013, 07:08 AM
Hello,

You're missing reference to cordova.js, add the following line just above jquery library:

<script type="text/javascript" src="cordova.js"></script>

Regards,
Steve
Telerik

Don't miss the Icenium May Release Keynote - sign up now!
Share feedback and vote for features on our Feedback Portal.
0
Jan-Dirk
Top achievements
Rank 1
answered on 28 May 2013, 07:57 AM
I recently saw this on the issuelist for Cordova: https://issues.apache.org/jira/browse/CB-3360

Not for the simulator but for setting a custom InAppBrowser user-agent, it would be nice to have the same functionality in the simulator in the future.
0
Steve
Telerik team
answered on 28 May 2013, 08:15 AM
Hi Jan-Dirk,

As soon as this feature makes its way in Cordova, we can consider making adjustments to the simulator as well, until then, oh well :)

Regards,
Steve
Telerik

Don't miss the Icenium May Release Keynote - sign up now!
Share feedback and vote for features on our Feedback Portal.
Tags
General Discussion
Asked by
bitbonk
Top achievements
Rank 1
Answers by
Steve
Telerik team
bitbonk
Top achievements
Rank 1
Jan-Dirk
Top achievements
Rank 1
Share this question
or