I could ricie myself here pretty good by asking this. but is there anyway to prevent frames from breaking. Examples of how to break them are everywhere, and makes sense.
But a way to stop a foreign page from exiting a frame or at least limit it’s chances would be pretty neat. I can both see why there wouldn’t be a way to do such a thing, but thought I’d throw it out there.
If a foreign site doesn’t want to be trapped in someone elses frames, then you should not try to stop it from breaking out of your frames. If it is possible, I certainly hope other members do not share how to do this.
I know that it wouldn’t be considered a good tactic and I can appreciate if you don’t want to share any info.
I’m writing an app that provides search results in a frame view, that opens in a new window. You can see how I run into problems when sites break out of the frames. and as such exit my explorer. I’m providing them a service so that others can rank their site, and send traffic to it, so in this case I don’t feel that I’m breaking any ‘webmaster code of conduct’ or anything like that.
Basically if a site like mine attempt to break out of your frames, then we don’t want to be a part of your “service” and yes it would be bad conduct even if you weren’t placing ads. Also some (poorly designed) sites can run into functional problems if they are caught inside of someone else’s frames especially if they use frames themselves because it can cause the mistargeting of links, etc.
Many folks here at SitePoint are always good at being brutally honest. Often times what seems like a good idea on the surface is not so great of an idea once one digs a little and sees the ramifications.
While I agree that a site owner may not want people to actually steal content by opening pages within frames, I will disagree in two ways:
a) A well designed site will always have the owner’s data, image, etc… so as a site owner it may even be good that someone includes the site in a frame. It is a way to get more traffic.
b) There are legitimate ways to show third party’s sites within another site, particularly in traffic exchanges and other online marketing resources. A site that breaks out of frames disrupts a legitimate TE operation. A traffic exchange, among other web marketing sites, may certainly use a script that stops frame breakers. btw… it is rather simple to stop the most common frame breaking script.
This is just a matter of responsibility.
I know many programmers, Internet users and experts regard online marketers as some kind of “bad guys” (to say the least) but it is still a legitimate business and a millionaire industry.