webOS Nation Forums >  Homebrew >  webOS Patches > iPhone User Agent Spoof - How to make all mobile websites display perfectly
iPhone User Agent Spoof - How to make all mobile websites display perfectly
  Reply
Like Tree8Likes

 
Thread Tools Display Modes
Old 08/29/2009, 05:10 PM   #1 (permalink)
Member
 
Posts: 924
[Updated: 4 March 2010]

We all know that webOS devices like the Palm Pre and Palm Pixi have a fantastic web browser that handles full web pages very well. But I've noticed that many mobile websites designed for the small screen of mobile devices don't display properly on the Pre or Pixi. To add insult to injury these same sites display perfectly on the iPhone which uses the same browser engine.

The problem is that these mobile sites do not recognize webOS devices and send them generic, unoptimized web pages that don't look good or work very well. On the other hand these sites recognize the iPhone and send it web pages that are optimized to look and work perfectly on it.

My solution is to change the browser on webOS devices so that it adds an "iPhone" tag to the identifying string it sends to web sites (along with the normal webOS and Palm device tags). This causes most web sites that don't know about webOS devices to think that it is an iPhone and send the iPhone optimized version of the web page rather than a generic unoptimized version. Since the browser on webOS devices can display the iPhone version of web pages correctly, this allows nearly all mobile web sites to display a properly working and optimized version on webOS devices even without direct support for them. Technically I accomplish this by patching a library on the Pre to modify the user agent string sent to websites. (If you don't understand that last sentence that's OK.)

Here is how the USA Today mobile web site looks before the patch:


And after the patch is applied:


You need to be able to access a root command line on your Pre to use this patch. This is very easy to do by downloading the developer's kit from Palm, putting your Pre in developer mode a running the novaterm program on your computer. See this site for complete instructions.

I and others have extensively tested this patch and it has proven to be very safe. There is a lot of error checking to make sure nothing unexpected or bad happens to your phone. However, it's a very good idea to back up your phone before doing this just in case. You may only use this patch if you accept that no one other than you yourself is responsible for any problems you may have if you try this.

How to install:
  1. Download the attached change-user-agent_universal.zip file to your computer. This version should work for everyone on any webOS device running any recent version of webOS on any mobile network.
  2. Unzip the file to reveal another file called "change-user-agent" .
  3. Attach your Pre to your computer using the USB cable and put the Pre in USB Drive mode.
  4. Copy the "change-user-agent" file to your Pre using your computer's normal method. Put the file in the root of the drive while it is in USB mode and not in a subdirectory (this ends up being the /media/internal directory from the command line).
  5. Access a root command line on your Pre. You can do this using Palm's "novaterm" program installed as part of the developer's kit or by using an SSH client program if you have installed an SSH server on your Pre. See this site for instruction on how to access the Linux root command line on your Pre.
  6. From the command line run the file. Simply type:
    /media/internal/change-user-agent
    Your Pre will reboot with the patch installed.
If you decide you would like to uninstall the patch and revert back, simply follow the above instructions and add the work "uninstall" on the command line in step #6. For example:
/media/internal/change-user-agent uninstall
Enjoy! If you find this useful please post a reply here to keep this thread alive so that others will see it. Thank you!

UPDATE: Now plays nice with Google Maps!

UPDATE 2
: (No longer applies.)

UPDATE 3: Now the normal, safe version of the patch works perfectly with virtually every mobile web site. There is no longer any version that breaks Google Maps. Many thanks go to hofs1 for the idea that made things perfect!

UPDATE4: Should now work for Bell Canada Devices.

UPDATE5: Now the patch is a simple shell script without any binary files. It uses the 'sed' command to change the library instead. This makes the patch much more transparent and easy to understand for those that wish to audit what it is doing.

UPDATE6: Now the patch should work on any webOS device running any recent version of webOS on any mobile network. Yes, this means the patch should (hopefully) work for GSM Pre users as well as Pixi owners. Please test this as I do not have any of these devices.

UPDATE7: Updated to work on webOS 1.4. Also reworded the blurb that describes what the patch does to make it more accurate.
Attached Files
File Type: zip change-user-agent_universal-2.4.1.zip (2.0 KB, 3771 views) Email Attachment

Last edited by ryleyinstl; 09/03/2010 at 10:08 AM. Reason: Renamed Thread so it can be found better when searching
clipcarl is offline   Reply With Quote
Liked by UpTheRams, mrpotter0709 and smaulz like this.
Old 08/29/2009, 05:37 PM   #2 (permalink)
Member
 
Posts: 25
This looks fantastic!! I'll let you know if I have any troubles after the install.

My tired old eyes are going to be so happy!
tim.gier is offline   Reply With Quote
Old 08/29/2009, 05:39 PM   #3 (permalink)
Member
 
Posts: 25
Should you have posted this in the development forum??
tim.gier is offline   Reply With Quote
Old 08/29/2009, 08:06 PM   #4 (permalink)
Moderator
 
Gaurav's Avatar
 
Posts: 8,277
Wow thanks. Do you have any plans on making this work with the webos Quickinstall patch install method or perhaps preware? Thanks!
__________________
_________________
aka Gfunkmagic

Current device: Palm Pre
Device graveyard: Palm Vx, Cassiopeia E100, LG Phenom HPC, Palm M515, Treo 300, Treo 600, Treo 650, Treo 700p, Axim X50v, Treo 800w



Please don't PM me about my avatar. For more info go here.

Restore your Pre to factory settings using webos doctor and follow these instructions
Gaurav is offline   Reply With Quote
Old 08/29/2009, 08:45 PM   #5 (permalink)
Member
 
Posts: 130
I do a lot of browsing and this is just what I needed. It works beautifully. I was starting to get fed up with these mobile sites that didn't look right.
All the mobile sites look normal except popurls.com where the links just overwriting the main menu screen.
Google looks seemed to work better for me when it was optimized for the Palm Pre. Is there a way to make an exception for gmail & igoogle?

Thank you.

Last edited by odontastic; 08/29/2009 at 09:18 PM.
odontastic is offline   Reply With Quote
Old 08/29/2009, 09:42 PM   #6 (permalink)
Member
 
spepi's Avatar
 
Posts: 17
i'll be trying this monday....thats one of my pet peeves...whe browser is horrible
spepi is offline   Reply With Quote
Old 08/29/2009, 09:42 PM   #7 (permalink)
Member
 
Posts: 130
Unfortunately after installing this patch Google maps don't work properly. At first I thought that gmail was broken too, but after a couple of refreshes, it's fine. Launching Google Maps from the built-in application icon dumps me into Latitude and it is unable to update my location or allow me to zoom or pan around the map. But at least there's still Sprint Navigation.
odontastic is offline   Reply With Quote
Thanked By: clipcarl
Old 08/29/2009, 09:45 PM   #8 (permalink)
Member
 
Sheuba's Avatar
 
Posts: 45
Working great. Thank you!
Sheuba is offline   Reply With Quote
Old 08/29/2009, 10:14 PM   #9 (permalink)
Member
 
awrnsmn's Avatar
 
Posts: 646
looks great...thank you!
awrnsmn is offline   Reply With Quote
Old 08/29/2009, 10:19 PM   #10 (permalink)
Member
 
Posts: 2
Looks great to me, too. Unfortunately, I'll probably uninstall since I have the same problem with Google Maps.
ja99 is offline   Reply With Quote
Thanked By: dozara89
Old 08/29/2009, 10:26 PM   #11 (permalink)
Member
 
shadavis08's Avatar
 
Posts: 9,321
man there has got to be an easier way lol im not that puter literit ha ha
shadavis08 is offline   Reply With Quote
Thanked By: dozara89
Old 08/29/2009, 10:27 PM   #12 (permalink)
Member
 
superduperpre's Avatar
 
Posts: 110
Quote:
Originally Posted by clipcarl View Post
You may only use this patch if you accept that I and no one other than you yourself is responsible for any problems you may have if you try this.
erm. you might wanna modify that given that in the current form you are stating that you wholeheartedly share the responsibility for problems with the end user.
superduperpre is offline   Reply With Quote
Thanked by clipcarl, dozara89
Old 08/29/2009, 10:45 PM   #13 (permalink)
Member
 
Posts: 924
Quote:
Originally Posted by odontastic View Post
Unfortunately after installing this patch Google maps don't work properly. At first I thought that gmail was broken too, but after a couple of refreshes, it's fine. Launching Google Maps from the built-in application icon dumps me into Latitude and it is unable to update my location or allow me to zoom or pan around the map. But at least there's still Sprint Navigation.
Ugh! Thanks for pointing this out. I'll see if I can find a way to do this and still have Google Maps work. Stay tuned...
clipcarl is offline   Reply With Quote
Old 08/29/2009, 10:52 PM   #14 (permalink)
Member
 
gage006's Avatar
 
Posts: 543
Sounded awesome until it killed Google Maps. Hopefully there's a fix for that.
gage006 is offline   Reply With Quote
Old 08/29/2009, 11:33 PM   #15 (permalink)
Member
 
Posts: 924
Google Maps problem has been fixed. Uninstall, redownload, reinstall.
clipcarl is offline   Reply With Quote
Old 08/30/2009, 12:02 AM   #16 (permalink)
Member
 
jbg7474's Avatar
 
Posts: 3,821
So, just wondering out loud, could there not be another way to do this? You know how the browser will display these pages correctly if you go to a working mobile site (such as m.precentral.net) and rotate to landscape and back before visiting the site? Can this a patch automatically set the browser to that state on opening instead of identifying itself as an iPhone? I don't want to mess up all the ad trackers out there by having them think there's yet another iPhone out there.
jbg7474 is offline   Reply With Quote
Thanked By: knobbysideup
Old 08/30/2009, 12:04 AM   #17 (permalink)
Member
 
Posts: 2
Uninstalled and reinstalled, and now Google Maps is normal, and web pages look great. Thanks!
ja99 is offline   Reply With Quote
Old 08/30/2009, 12:08 AM   #18 (permalink)
Member
 
Posts: 134
Thanks for this but it really be the responsibility of web developers to get off their lazy asses and realize there are other webkit-browser phones out there.
shadowgod is offline   Reply With Quote
Thanked By: knobbysideup
Old 08/30/2009, 02:40 AM   #19 (permalink)
Member
 
Posts: 1,045
Good stuff clipcarl; I second the request to, if possible, make this tweak available via quickinstall/preware/etc?
Carioca_FL is offline   Reply With Quote
Old 08/30/2009, 02:42 AM   #20 (permalink)
Member
 
Posts: 1,045
Can anyone check Netflix's mobile page? As with other "mobile" pages, it displays fine on the iPhone, but not so great on the Pre's browser.

Netflix Mobile Page
Carioca_FL is offline   Reply With Quote
Thanked By: exhero
Reply

 

Thread Tools
Display Modes



 


Content Relevant URLs by vBSEO 3.6.0