1
mouacy
How do I prevent my site from being display in an iframe in other's page?
  • 2005/2/26 1:13

  • mouacy

  • Not too shy to talk

  • Posts: 138

  • Since: 2002/11/2


I search in google and find only how to make an iframe. But I want to put a script on my page that will prevent it from being display in an iframe. Anyone?

2
just4fun
Re: How do I prevent my site from being display in an iframe in other's page?
  • 2005/2/26 1:40

  • just4fun

  • Just popping in

  • Posts: 55

  • Since: 2003/7/28


<script language="JavaScript" type="text/javascript">

script>


add FrameBuster to onload event of body

<body onload="FrameBuster()">



3
mouacy
Re: How do I prevent my site from being display in an iframe in other's page?
  • 2005/2/26 6:17

  • mouacy

  • Not too shy to talk

  • Posts: 138

  • Since: 2002/11/2


I tried it with firefox and it doesn't work.

I add the function
Quote:

function FrameBuster() {
if (top !=self)top.location=self.location;
}


to the xoops.js and call it from



Doesn't work. Any more clue?

4
mouacy
Re: How do I prevent my site from being display in an iframe in other's page?
  • 2005/2/26 6:26

  • mouacy

  • Not too shy to talk

  • Posts: 138

  • Since: 2002/11/2


Also try it with IE6.0 and it doesn't work.

I place
Quote:




inside the header of the theme.html file just below the xoops.js

and add onload="FrameBuster()" to the to become



no luck so far.

5
mouacy
Re: How do I prevent my site from being display in an iframe in other's page?
  • 2005/2/26 6:46

  • mouacy

  • Not too shy to talk

  • Posts: 138

  • Since: 2002/11/2


It doesn't seem to work with iframe.

6
felix220
Re: How do I prevent my site from being display in an iframe in other's page?
  • 2006/3/11 23:56

  • felix220

  • Friend of XOOPS

  • Posts: 8

  • Since: 2004/12/26


This is an old thread but I can see nothing else relevant.

I am trying to add the code to bust out of a frame and have searched about but can't see any conclusive solution [for a beginner]

I have edited the theme.html in the header/body, but I notice that the changes do not appear to load.. so I looked at header.php and noticed this line..

// Weird, but need extra