Suggestion: how to stop outside sites framing your site! :)

Main forum for site announcements, suggestions, and help.

Moderators: Savor Dam, Vain

Post Reply
Mystikan
Woodhelvennin
Posts: 68
Joined: Wed Mar 17, 2004 6:56 pm
Location: South Australia
Contact:

Suggestion: how to stop outside sites framing your site! :)

Post by Mystikan »

Webmaster: want to stop sites like hotmail framing your site with their header frame?

I track several topics in these forums and receive reply notifications at my hotmail addy with clickthrough links to the threads in question. I've noticed that hotmail stick an annoying header with "You are visiting a site outside hotmail" on it. It eventually seems to go away if I click enough links, so you might already be familiar with this bit of Javascript:

Code: Select all

<script type="text/javascript">
<!--
	var killFrames = (top == self);
	if (!killFrames) top.location.href = 'http://yourdomain.com/yourpage.htm';
//-->
</script>
In case you're not, this code simply "breaks out" of any frames enclosing the page with this bit of script, so the page kills the top frame and fills the browser window itself. I've done this on every page on my own site, and I think it would be good if you could do it with this one as well. It's cheeky of hotmail to do this and it would feel good to be able to click on the notification links and get rid of hotmail's framing instantly! Mwahahahahaha!! :twisted: :twisted: :twisted:
The only difference between light and dark is the ability to tell the difference.
User avatar
I'm Murrin
Are you?
Posts: 15840
Joined: Tue Apr 08, 2003 1:09 pm
Location: North East, UK
Contact:

Post by I'm Murrin »

A problem - stephenrdonaldson.com displays Kevin's Watch within frames. Adding killframe code would stop that working (I'm assuming that the official site wants KW to be kept in the site's frames?).
Mystikan
Woodhelvennin
Posts: 68
Joined: Wed Mar 17, 2004 6:56 pm
Location: South Australia
Contact:

Post by Mystikan »

Hmm, that is a bit of a poser. Might be worth checking with SRD or his webmaster to see if this is the case. Would it be a viable alternative for SRD's site to open the forums in a new window? Like this:

Code: Select all

<a href="http://www.kevinswatch.ihugny.com/phpBB2/index.php" target="_blank">Discussion</a>
Looking at the site, I can see why they'd want to frame the KW site for consistency of presentation, but if someone is running a higher resolution than 800x600 (I run 1600 x 1200 / 1280 x 1024 dual-monitor) then the forum site is squashed into the top left corner of the screen, with loads of blank space around it - can make it a bit hard to read. I personally think opening the forums in a separate window, so the main site still stays on the viewer's desktop, but the forum page goes full window, would be good - or, alternatively, use Javascript on the site to detect the user's resolution and resize the frames accordingly (although that doesn't solve the frames problem). :roll: Or use Javascript on the KW site to check the referrer and if it isn't stephenrdonaldson.com then kill the frames...hmm, maybe not, that's starting to look like code bloat... |H

Anyway, I'll have a dig around on the Web and see if I can find a way of killing hotmail's irritating frame from my end...
The only difference between light and dark is the ability to tell the difference.
User avatar
danlo
Lord
Posts: 20838
Joined: Wed Mar 06, 2002 8:29 pm
Location: Albuquerque NM
Been thanked: 1 time
Contact:

Post by danlo »

I shall direct the Official SRD site management to this thread. 8)
fall far and well Pilots!
User avatar
Romeo
The Gap Into Spam
Posts: 1194
Joined: Fri Dec 27, 2002 1:22 pm
Location: Ashland, PA, USA
Contact:

Post by Romeo »

You can always right-click on the link and select "open in new window" to get it to appear outside the official site.

I believe it was put into the official site frame since that makes it look more official and integrated.
And then the ravens pecked out his eyes.
User avatar
danlo
Lord
Posts: 20838
Joined: Wed Mar 06, 2002 8:29 pm
Location: Albuquerque NM
Been thanked: 1 time
Contact:

Post by danlo »

|T "That's too easy!" :x :P
fall far and well Pilots!
User avatar
Romeo
The Gap Into Spam
Posts: 1194
Joined: Fri Dec 27, 2002 1:22 pm
Location: Ashland, PA, USA
Contact:

Post by Romeo »

Can Vain or Jay add another button to the site for "View Full" or something like that? If it's encased in the same code as above, with a document.write command given in the IF statement, then the button will only appear if the site is framed within another site - if it's already in it's own frame then the button won't appear.

I have some other ideas in mind. Just have to clear some other things off my desk before I write them down...
And then the ravens pecked out his eyes.
User avatar
kevinswatch
"High" Lord
Posts: 5592
Joined: Sat Mar 02, 2002 2:46 pm
Location: In the dark, lonely cave that dwells within my eternal soul of despair. It's next to a Pizza Hut.
Has thanked: 6 times
Been thanked: 5 times
Contact:

Post by kevinswatch »

Um...I'm confused. Why should I care about this?-jay
User avatar
danlo
Lord
Posts: 20838
Joined: Wed Mar 06, 2002 8:29 pm
Location: Albuquerque NM
Been thanked: 1 time
Contact:

Post by danlo »

Perhaps this should be discussed elsewhere? :?
fall far and well Pilots!
User avatar
Lord Mhoram
Lord
Posts: 9512
Joined: Mon Jul 08, 2002 1:07 am

Post by Lord Mhoram »

kevinswatch wrote:Um...I'm confused. Why should I care about this?-jay
I totally know how you feel dude. I have that feeling every day... :lol:
Post Reply

Return to “Announcements + Suggestions + Q&A + Help”