Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Add iPad to the list of User Agents in Safari's Develop menu Web Browsers
If you're curious about how iPad-specific versions websites of your favorite websites are rendered, but don't actually own an iPad yet, here's a way to view those pages using your Mac's version of Safari.

Caution: This tip requires that you modify a file within Safari.app's Resources folder. I cannot guarantee this will not cause you grief, or break the application's code signing.

This tip also requires you to install the Developer's Tools (for the use of Property List Editor.app), or at least be familiar with editing .plist files.

Here's how to do it:
  1. From Safari, go to the Preferences menu and select the Advanced tab, then enable 'Show Develop in menu bar.' Quit Safari when done.
  2. In Finder, select Go » Go to Folder, and when the dialog box appears, enter this path: /Applications/Safari.app/Contents/Resources.
  3. In the Resources folder, locate the file named UserAgents.plist. Back up the file somewhere safe just in case your editing goes awry -- I dragged it to my Desktop and renamed it UserAgents.plist.bak.
  4. Open the original UserAgents.plist file with Property List Editor.app.
  5. Somewhere between the items that already exist, you will want to create a new entry. I found that Item 4 was just a separator and Item 5 was the first of the Mobile Safari user agents. I simply copied Item 5 and pasted it. (Select Item 5, then press Command-C followed by Command-V). This copies all the attributes of Item 5 to a new entry called Item 6, and renumbers all the entries that follow.
  6. Change the properties of Item 5 to match the iPad's characteristics (name = "Mobile Safari", version= "3.2", platform= "iPad").
  7. For the user-agent string, enter the user agent properties of the iPad (gleaned from this link):
    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/7B334b Safari/531.21.10
  8. Choose File » Save As, and save to the Desktop. Do not change the name.
  9. Drag the UserAgents.plist file from the Desktop into the /Applications » Safari » Contents » Resources folder. (Finder will ask you to want to replace the original and will ask you to authenticate.)
  10. Open Disk Utility.app and run a Repair Permissions on your hard drive.
That's it. Relaunch Safari, and in the Develop menu, select User Agent". You will now see an option to use the iPad user agent string. When selected, sites like GMail and Facebook will display the iPad versions of their sites.

Enjoy! Remember, I make no promises that this won't muck up your Safari.app. Seems to be working well for me, anyways.
    •    
  • Currently 2.31 / 5
  You rated: 2 / 5 (13 votes cast)
 
[24,463 views]  

Add iPad to the list of User Agents in Safari's Develop menu | 15 comments | Create New Account
Click here to return to the 'Add iPad to the list of User Agents in Safari's Develop menu' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Add iPad to the list of User Agents in Safari's Develop menu
Authored by: asmeurer on Apr 14, '10 08:20:55AM

Easier method:

Enable the develop menu in Safari.

Choose User Agent -> Other…

Paste the string given in the hint.



[ Reply to This | # ]
Add iPad to the list of User Agents in Safari's Develop menu
Authored by: hzc on Apr 14, '10 08:31:10AM

That'll work, but it won't give you a permanent menu item. The way described in this hint allows you to always have easy access it the iPad agent.



[ Reply to This | # ]
Add iPad to the list of User Agents in Safari's Develop menu
Authored by: hypert on Apr 14, '10 11:20:39AM

Yeah, but who wants to keep a bunch of UA strings in your head? That's why this menu exists and UA plugins exist for some browsers.

Nice hint.



[ Reply to This | # ]
Add iPad to the list of User Agents in Safari's Develop menu
Authored by: pepijndevos on Apr 14, '10 08:43:54AM

Are there any websites with a specific iPad interface?

You can also download the SDK to view with an iPad by the way.



[ Reply to This | # ]
Add iPad to the list of User Agents in Safari's Develop menu
Authored by: kiltbear on Apr 14, '10 12:40:15PM

www.nyt.com home page is flash free

www.npr.org has done a nice job with a floating mp3 player at the bottom and a format that works very well.



[ Reply to This | # ]
Add iPad to the list of User Agents in Safari's Develop menu
Authored by: asmeurer on Apr 14, '10 12:50:40PM
Apple has a list of a couple:

http://www.apple.com/ipad/ready-for-ipad/

[ Reply to This | # ]
Add iPad to the list of User Agents in Safari's Develop menu
Authored by: ManxStef on Apr 14, '10 11:30:14AM

Alternatively, as pepijndevo mentions, register for a free Apple Developer account and download the (albeit huge) iPad SDK:
http://developer.apple.com/ipad/sdk/

Install it and run the iPhone Simulator in /Developer/Platforms/iPhoneSimulator.platform/Developer/Applications. Switch it to the iPad by selecting Hardware, iPad from the menu, then run Safari as you would on a real iPad.

This offers the advantage of using the actual iPad-specific build of Safari, which is different to the OS X version, so will give more accurate results.



[ Reply to This | # ]
Add iPad to the list of User Agents in Safari's Develop menu
Authored by: tobylane on Apr 17, '10 10:35:55AM

iPad SDK, and iPhone 4, aren't free. Shame no-one illegally hosts them.



[ Reply to This | # ]
Add iPad to the list of User Agents in Safari's Develop menu
Authored by: ManxStef on Apr 17, '10 10:49:46AM

Ah, apologies for the confusion. The standard Xcode 3 + iPhone SDK, which includes the iPhone/iPad Simulator, is available to free Apple Developer accounts. It costs to actually sign up for the iPhone Developer Program, which enables you to release apps on the App Store and grants access to the SDK 4.0 beta (which includes the iPad SDK), but you don't need this to get the iPad Simulator.



[ Reply to This | # ]
Add iPad to the list of User Agents in Safari's Develop menu
Authored by: cDizzle on Apr 18, '10 04:06:56PM

Nope. The iPad Simulator is not included in the latest Xcode (3.2.2) and is not free. You need to sign up for a $99 Developer account to get the iPad Simulator functionality.



[ Reply to This | # ]
Add iPad to the list of User Agents in Safari's Develop menu
Authored by: ManxStef on Apr 18, '10 04:12:46PM

Uh, it really is - It's part of the iPhone Simulator - I have it and I'm not a paid dev, just using the standard free XCode +iPhone SDK.

Launch the iPhone Simulator ( /Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app ), go to Hardware, Device and tick iPad. Then run Safari as you would on a real iPad.



[ Reply to This | # ]
Add iPad to the list of User Agents in Safari's Develop menu
Authored by: bdash on Apr 14, '10 12:32:08PM

This is guaranteed to invalidate Safari’s code signature which will lead to a number of mysterious problems, the most visible of which will be a failure to access usernames and passwords stored in the keychain. That’s going to be much more of an inconvenience than using the “Other…” menu item.



[ Reply to This | # ]
Add iPad to the list of User Agents in Safari's Develop menu
Authored by: cDizzle on Apr 15, '10 05:52:20PM

I have not run into an issue with usernames/passwords or any of the items in my Keychain while using this method. Sometimes, however, when viewing YouTube, the thumbnails will incorrectly appear on the left side instead of the right. This is when Safari's user agent is on "Default (Automatically Chosen)." This is the only oddity I have encountered. But, as I stated when I prefaced this hint, this will most likely cause code signing issues down the road. Seems to work just fine for now, anyhow.

Oh, and you can also add even stranger user agent strings, like I do for PS3 and Wii using the same method.



[ Reply to This | # ]
Add iPad to the list of User Agents in Safari's Develop menu
Authored by: cDizzle on Apr 18, '10 04:13:07PM

The weird thumbnail issue in YouTube is caused by some bug with YouTube's HTML5 opt-in program. It has nothing to do with the user agent mod that I posted. Here's a description of that issue on Google's help page: link: http://www.google.com/support/forum/p/youtube/thread?tid=5178a54118b15b04&hl=en



[ Reply to This | # ]
Add iPad to the list of User Agents in Safari's Develop menu
Authored by: Misafir on Jun 26, '10 07:55:11PM

This offers the advantage of using the actual iPad-specific build of Safari, which is different to the OS X version, so will give more accurate results. i will chechk in my site.



[ Reply to This | # ]