Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-06-2010, 08:58 PM   PM User | #1
hyperipod
New to the CF scene

 
Join Date: Nov 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
hyperipod is an unknown quantity at this point
Macintosh Changing iFrame user agent in Safari

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]
hyperipod is offline   Reply With Quote
Old 11-06-2010, 10:41 PM   PM User | #2
Apostropartheid
The Apostate


 
Apostropartheid's Avatar
 
Join Date: Oct 2007
Posts: 3,215
Thanks: 16
Thanked 265 Times in 263 Posts
Apostropartheid is on a distinguished road
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.
__________________
Blog | Twitter
Useful links: W3C HTML Validator | W3C CSS Validator | HTML 5 Guide
CF: HTML & CSS Resources/Tutorials Thread | HTML & CSS Posting Rules and Guidelines
Remember: no link, no code, no help!
Apostropartheid is offline   Reply With Quote
Reply

Bookmarks

Tags
iframe, safari, user agent

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:39 AM.


Advertisement
Log in to turn off these ads.