1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

A tip to help you break iFrames of digg and Google Images!

Discussion in 'PHP & Perl' started by varundbest, Jan 19, 2010.

  1. varundbest

    varundbest Jr. VIP Jr. VIP Premium Member

    Joined:
    Oct 15, 2009
    Messages:
    763
    Likes Received:
    495
    If you have any blog and would like to break those iFrames (tested for - blogger, wordpress, B2evolution) Use this script -
    Code:
    <script>
    if(location.href!=top.location.href){
        top.location.href=location.href
    }
    </script>
     
  2. cepluk

    cepluk Junior Member

    Joined:
    Apr 27, 2009
    Messages:
    157
    Likes Received:
    4
    could you help me how to use it and where to place this script? i'm completely newbie
     
  3. blackplastic

    blackplastic Newbie

    Joined:
    Jan 18, 2010
    Messages:
    7
    Likes Received:
    0
    I wasn't able to get the code above to work, regardless of placement (in body, in head, in included js file, didn't matter). I was able to get this to work, though...

    Code:
    <head>
    <title>some title</title>
    <script type="text/javascript" src="/includes/js/reframe.js"></script>
    </head>
    <body> etc, etc, etc...
    
    The "reframe.js" file contains the following:
    Code:
    if (parent.frames.length > 0) top.location.replace(document.location);
    
    Works when tested from g00g images on Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.16) Gecko/2009121609 Firefox/3.0.6 (Debian-3.0.6-3).