Anti-Frame Busting Code

Discussion in 'HTML & Website Design' started by Methoss, Oct 13, 2008.

  1. #1
    I'm trying to frame a site for a client, but the company he has his site thru has a frame busting code in their pages that they don't know about. :eek:

    <script language="JavaScript">
    <!--
    if (self.parent.frames.length != 0){
    self.parent.location=document.location;
    }


    -->
    </script>​
    I found using the following code in the frame works in IE,

    security="restricted" ​

    but need to find a fix for firefox at least.
    Any help would be greatly appreciated.
     
    Methoss, Oct 13, 2008 IP
  2. 101tricks

    101tricks Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    This seems to work if? it's what you need.

    <script language=”JavaScript1.1″ type=”text/JavaScript”>if (parent.frames.length
    > 0) top.location.replace(document.location);</script>

    Just put that script in your header and you’re done!

    Take care
     
    101tricks, Oct 14, 2008 IP
  3. Methoss

    Methoss Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    well, thanx for trying.
    Guess we only have 2 choices left, rebuild the page from the ground up, or somehow teach this company how to remove the code (the delete key is great).
     
    Methoss, Oct 15, 2008 IP
  4. div3x

    div3x Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    i have a code that works! just pm me
     
    div3x, Jul 16, 2011 IP
  5. TexasWebDevelopers

    TexasWebDevelopers Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    <style type="text/css">
    html { visibility:hidden; }
    </style>
    <script language="javascript" type="text/javascript">
    if ( self == top ) {
    document.documentElement.style.visibility='visible';
    } else {
    top.location = self.location;
    }
    </script>

    Based on the Stanford Web Security Group paper "Busting Frame Busting: A Study of Clickjacking Vulnerabilities at Popular Sites" with the caveat that this technique may have unintended impact on SEO although we have not been able to confirm yet.
     
    TexasWebDevelopers, Dec 10, 2011 IP