PDA

View Full Version : Changing iFrame user agent in Safari



hyperipod
11-06-2010, 08:58 PM
I'm creating a customized homepage for Safari 5 on my 15" MBP.

It's four websites side by side (Gizmodo mobile, Engadget mobile, MacRumors mobile, Yahoo! Mail Mobile).

MacRumors and Yahoo! Mail work just fine.

But on Engadget and Gizmodo, when I click on a link, it goes on the full website and I can't see the whole page because of the size of my iFrame.

But both of them work the way I wan't when I change my user agent to iPhone.

Can I assign a user agent to an iFrame or the whole page? Or is there any other way around?

Thanks.


Here's the code of my Homepage for now:

[CODE]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
<title>Homepage</title>
</head>
<body>
<iframe src="http://gizmodo.com/?view=mobile" style="border:1px solid;" name="frame1" scrolling="auto" frameborder="yes" height = "705px" width = "345px">
</iframe>
<iframe src="http://m.engadget.com" style="border:1px solid;" name="frame1" scrolling="auto" frameborder="yes" height = "705px" width = "350px">
</iframe>
<iframe src="http://mobile.macrumors.com" style="border:1px solid;" name="frame1" scrolling="auto" frameborder="yes" height = "705px" width = "345px">
</iframe>
<iframe src="http://m.mg.mail.yahoo.com/hg/?.intl=ca&.lang=fr-ca#/mail/list?fid=Inbox" style="border:1px solid;" name="frame1" scrolling="auto" frameborder="yes" height = "705px" width = "345px">
</iframe>
</body>
</html>
[CODE]

Apostropartheid
11-06-2010, 10:41 PM
Vous parlez franšais, non ?
There's no real way to do this without setting the user-agent string for the entire browser, as far as I can tell. You may be able to do this in JavaScript, but it would involve AJAX somehow.
I think you should seriously consider using Google Reader, though.
Also worth nothing is that your iframes all have the same name.