SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2008
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    gmail in iframe hijacks whole page

    Hi: Spent over an hour digging for info. This is for a personal page. I just wanted a few sites on one page so i started with two iframes - one for yahoo mail and the other for google mail (gmail) I did this for someones myspace and 360 pages and it seemed to work ok. yahoo, 360, and myspace seem to work ok and you can navigate within the frames. gmail loads up ok unless i log in or am already logged in in another firefox tab. When I'm logged in to gmail, both frames go away, the address bar reflects the url to my inbox, and that inbox occupies the whole page - not in that order, of course. Not sure how gmail does that, either.

    Is there a way around this or is there *any* way to make this work? I feel iframes are an ugly hack for this, but am not sure a div overlay is the best solution though it sounds doable. For now I'd like to stick with the iframes.

    For a div overlay (or span) wouldn't I have to somehow load the content into a variable and innerHTML it into the div/span? If anyone knows the JS or PHP methods/functions to load a page from a url into a variable, please tell.

    Thanks in advance
    mike

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It sounds as if Gmail uses some JavaScript frame breaker, probably because they don't want their application in someone else's frameset. (I haven't checked Gmail's TOS.)

    If you disable JavaScript you may put a stop to this, but I suspect that Gmail will stop working, too. The only option I can come up with is to use a proxy script on your own site, that requests the Gmail page and strips out that particular piece of JavaScript. You should check Gmail's TOS first, though, to see if this is permitted at all.
    Birnam wood is come to Dunsinane

  3. #3
    SitePoint Enthusiast
    Join Date
    Aug 2008
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Cuckoo. I think I found enough code to learn how it's done now - proxy, that is. Though not for public consumption, I appreciate the TOS warning in case I do something like this for others in the future. For now, most stuff I'm viewing on one page works ok in the iframe - even myspace. So having one extra tab open for gmail isn't a big deal.

    BRs
    mike


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •