smerf a écrit :
Will this work for trapping someone else's frames?
Basically I want to make a site like www.torrentscan.com (beware of the
irritating popup) but for educational links. Some of the sites that may be
added will try and break out of the main content frame.
Ha OK, you don't want to see your own pages to do so.
But want these from other sites stop to do it and stay in your frames.
It is very incorrect to show a page from an other site in the window of
your own site.
Hpwever, since I am not claiming their content as my own,
However they *seem to* belong to your site.
Is there a real difference between to copy a page or to capture it ?
Both can be interpreted as stolen.
nor am I altering their content in any way,
Contrefaçon, copy, clone, captured --all the same : they aren't yours.
I want to be able to force them to stay in a frame next
to my searchbox/sidebar like on www.torrentscan.com (again, beware of the
irritating popup).
I saw no popup (anti-popup in FireFox)
I think all what you see here are pages from torrent (and his associated
sites, probably from same domain) distributed via a google engine.
You probably can find at Google a what engine for free to insert in your
site (for your own pages).
http://www.google.fr/intl/en/searchcode.html
I think to force pages having a javascript to go away from frames to
stay in your frame is not possible.
There is one other issue that they may have with my links page. If a user
wanted to bookmark their page, doing so from my framed page would not allow
that direct link.
Yes it's one of the problems.
I'd like to add an "Add to favorites" button above each
of their pages to allow users to add the framed pages directly to thier
bookmarks/favorites.
That doesn't work if visitor's browser is not IE ...
In your viewer frame you put an onload to call function to add this
button (call will be launched on each new page there displayed).
Code to put in your page of frames :
<script type="text/javascript">
function addFav() {
var b = document.create Element('button ');
b.onclick = function() {
window.external .AddFavorite(wi ndow.location,d ocument.title); }
var t = document.create TextNode('Add this page to favorites');
b.appendChild(t );
document.body.a ppendChild(b);
}
</script>
<frame name="viewer" onload="addFav( );" ...
Is this a pretty easy thing to do? Should I do it with yet another frame -
just right above the main content frame? And, can javascript read and
manipulate pages in other frames (to get the URL and description) even
though the other frames contain content from other domains?
To get url is not a problem (you have already got it to call the page).
Probably not allowed to get its content (but try it).
So have your button in menu/search frame
<button onclick="var url = parent.viewer.l ocation;
var title = parent.viewer.d ocument.title;
window.external .AddFavorite(ur l,title);">add to favorites</button>
if 'viewer' above is the name of the frame where are displayed other pages.
And I'm not sure of function about add favorite (I haven't IE Windows).
--
ASM