views:

65

answers:

2

I want to load gmail inside an iframe. It is small so that a iphone version gmail would be more suitable. However google change the address automatically to the PC version. Could anyone help? Is there any permanent address for the iphone gmail? PS. i need to use Chrome. Thanks!!

A: 

You should change the user agent parameter in the HTTP header to the one the iPhone's using. It's something like Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3

When you're using this parameter in the header, you'll always get the iPhone version of Gmail. You could do this manually, or you could download an add-on to accomplish the same; the User Agent Switcher add-on for Firefox is one.

Giu
but how to change the user agent in iframe? thanks!
Nicholas
thanks a lot! i hv a clearer mind now.
Nicholas
You have to set it in the HTTP request header. You either make the request by hand, or you let the browser handle this. If you're going to make the request by hand, you have to see in the docs of your preferred framework / language how it's possible to change the user agent in the request. If for example you're using PHP, [this](http://www.electrictoolbox.com/php-change-user-agent-string/) article describes how you could do it.
Giu
A: 

You can install this plugin in firefox

https://addons.mozilla.org/sv-SE/firefox/addon/59/

and then change User Agent in Firefox to iPhone 3.0

Having done that you will always get the 'iPhone version' of Gmail

igorti