Page 1 of 1
Suggestion: how to stop outside sites framing your site! :)
Posted: Wed Apr 14, 2004 8:14 am
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!!

Posted: Wed Apr 14, 2004 9:03 am
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?).
Posted: Wed Apr 14, 2004 11:45 am
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).

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...
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...
Posted: Wed Apr 14, 2004 12:35 pm
by danlo
I shall direct the Official SRD site management to this thread.

Posted: Wed Apr 14, 2004 12:49 pm
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.
Posted: Fri Apr 16, 2004 2:00 pm
by danlo
Posted: Fri Apr 16, 2004 2:59 pm
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...
Posted: Fri Apr 16, 2004 7:46 pm
by kevinswatch
Um...I'm confused. Why should I care about this?-jay
Posted: Fri Apr 16, 2004 8:07 pm
by danlo
Perhaps this should be discussed elsewhere?

Posted: Fri Apr 16, 2004 8:53 pm
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...
