- Community Home
- >
- Networking
- >
- Wireless
- >
- M and MSM Series
- >
- MSM765zl Max length of userAgent in javascript
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2010 11:29 AM - last edited on 12-01-2013 11:15 PM by Lisa198503
06-24-2010 11:29 AM - last edited on 12-01-2013 11:15 PM by Lisa198503
MSM765zl Max length of userAgent in javascript
OK, so in dealing with an iPhone/iPad login problem via the 765zl, I've had to recode the main login page. In the prototype.js file, there is a object that detects the userAgent (specifically Apple Safari in my case) with:
MobileSafari: !!navigator.userAgent.match(/Apple.*Mobile.*Safari/)
>
Unfortunately, this doesn't match newer devices. What I've found is that the Apple device is sending the entire userAgent as expected, but if I print out the value of the userAgent with:
<script>
document.write("js userAgent: "+navigator.userAgent+" ::END");
</script>
(in index.asp), then the userAgent string is truncated right before the 'Safari' portion. The odd thing is that this isn't a character position or number of words, but rather some other limit.
For example the following userAgent is printed in full (from an iPod Touch with os 2.x):
Mozilla/5.0 (iPod; U; CPU iPhone OS 2_2_1 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5H11 Safari/525.20
The following (iPad, OS3) is truncated with the last portion displayed being "Mobile/7B367":
Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B367 Safari/531.21.10
The last example is from an iPhone with developer version 4.0 on it, again, truncated right before 'Safari' (displaying 'Mobile/8A293'):
Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7
I'm currently just checking for /Apple.*Mobile/ instead of the full /Apple.*Mobile.*Safari/ that is in prototype.js.
I know that many web servers have a limit of 260 characters in the userAgent string, but I'm _way_ under that (146 for the iOS 4.0 phone, 145 for the working iPod 2.0) and 141 for the failing iPad 3.0).
Anyone see this before and know of a way to see the full userAgent string???
Thanks!
Tom
P.S. This thread has been moved from Communications, Wireless (Legacy ITRC forum) to MSM Series. -HP Forum Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2010 12:19 PM
06-24-2010 12:19 PM
Re: MSM765zl Max length of userAgent in javascript
If that's so, then I should be able to write a quick webpage to display the navigator.userAgent.
Yep, I could and did, here's what I found:
Turns out that if the Controller/Public access/Web content/'Redirect users to the Login page via:' has 'HTTP' checked, then the newer mobile devices will bring up the login page after you select the SSID. It seems that the browser that is used to display the login page isn't the 'full' Safari browser which truncates the length of the navigator.userAgent. If HTTPS is checked instead of HTTP, then the login page isn't brought up during the SSID selection and isn't displayed until the full Safari browser is launched. Then, the full userAgent string is displayed in all it's glory.
Looks to be an Apple problem after all.
Sorry for bothering everyone...
Tom