Forgot password?
Register For FREE
on SteadyHealth.com
Reply to topic Post new topic

Web Hosting Anti Frame Breaker solution

Did Anti Frame Breaker script help you?
Yes
100%
100% [ 3 ]
No
0%
0% [ 0 ]
Total Votes : 3
 
AUTHOR
 
 
MESSAGE
 
Posted: 6/7/05 3:26 PM
Report abuse 
Supporter Supporter
marcusm
Joined: May 18, 2005

Posts: 40
 
Recently I run into the problem with my web hosting provider. I have few pages which have used content in iframes. For some strange reason my web hosting company decided to automatically put frame breaker script in every page on my site. I was really pissed off since I couldn't find any workaround to frame breaker javascript. I even thought to change hosting provider. Then I started to experiment with javascipt and finally found the solution. I'm presenting you Anti Frame Breaker javascript.

It's tested by me and it works with following frame breaker script, which is in the same time most common one and as someone said "bulletproof". Well, not any more Smile

Frame Breaker script:
function frame_breaker()
{
if (top != self)
{
top.location.href = location.href;
}
}

And Anti Frame Breaker script:
The whole idea is to stop execution of javascript in the frame/iframe which doesn't suppose to takeover parent frame/window.
First put this function between html head tags:
<script>
function StopLoading()
{
if (!document.all)
{
window.stop();
}
else
{
window.document.execCommand('Stop');
}
}
</script>

Then just add onload event handler to iframe you want to supress, like this:
<iframe onload="StopLoading()" src="http://www.someaddress.com">

That's all!
I hope this script might help someone!

marcusm
Vote now!  Reply with quote
Did you find this post useful? 49 58
Posted: 3/24/09 6:31 PM
Report abuse 
Guest
Guest


 
Although 90% that script is leeched, nice job for finding it!
Vote now!  Reply with quote
Did you find this post useful? 49 58
Posted: 3/24/09 11:13 PM
Report abuse 
Guest
Guest


 
Hi !

On moments I was happy as baby Smile, but then I could not make it work Sad

Can you please explain me where the second part should be added in following code to make it work :



Now, situation is like this : I frame a inner page, but frame braker redirect to homepage and it redirect through linkbucks link. Any chance to beat all this ?
Vote now!  Reply with quote
Did you find this post useful? 49 58

Reply to topic Post new topic
 
TERMS BY POPULARITY
 
Drinking water with lemon helps clean the toxins out of your body.
 
USEFUL INFORMATION
 

What are the benefits of drinking water with lemon
Lemons have been present in our diet for centuries. They are usually used for making lemonade or mixed drinks, cooking, nowadays for cleaning products and air fresheners. Lemon can help our body in many ways, by stimulating the digestive system and purifying ...

 
My navigator
 
 
Poll
 

What other language do you speak besides English?

1. I speak Spanish
30.12%
2. I speak German
14.44%
3. I speak French
20.2%
4. I speak Mandarin Chinese
6.19%
5. I speak Hindi
13.41%
6. I speak Arabic
10.99%
7. I speak Portuguese
4.66%
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit posts in this forum
You cannot delete posts in this forum
You can vote in polls in this forum