SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Nov 2006
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    javascript foils proxy

    Hello list,
    I'm a bit new to javascript and I'm wondering if someone might help me with the following problem. I set up a proxy with php so that I can load documents outside my domain into an iframe and access the DOM. A few sites have something like the following code that keeps me from loading their sites into said iframe:
    if (window.self != window.top) {
    top.location.replace(window.location.pathname);
    }
    Is there a good way to counteract this? The code is often loaded in the head of a html document and is linked to, not directly on the HTML page in question.

    Any help would be appreciated. I've been trying to figure a good workaround that doesn't involve just erasing all links to javascript.
    Thanks.
    Best,
    Max

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    16,457
    Mentioned
    160 Post(s)
    Tagged
    1 Thread(s)

    no top

    Hi maxbenjamin, welcome to the forums,
    The best way to solve this is to contact the site's webmaster and explain your problem. They may be able to provide a link to a frame-able page for you to use.

  3. #3
    SitePoint Member
    Join Date
    Nov 2006
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks,
    The only problem is that this frame is "user-driven". The user decides what site will be loaded into the frame and so it becomes difficult to get the frameable versions. I'm currently rewriting all relative links as absolute links in the proxy so if there is something I could add to the page or some other sort of preprocessing that could be done that would be no problem. I'd just like to use something more elegant than a hammer if possible.
    Thanks again.


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
  •