views:

138

answers:

2

Understanding all the security and UI concerns with iFrames, I am implementing a toolbar similar to the DiggBar or FacebookBar.

A top bar persists across the top 30 pixels of the screen, and an iFrame displaying external content fills up the remainder of the page.

When users close the toolbar, and thereby exit my little site to go directly to the third-party site, how can I bust the iFrame properly and display the right page? If the user clicks on even one link in the iFrame, I end up showing the wrong page.

Given my understanding of browser security, and coupled with how DiggBar and FacebookBar fail to do this accurately, I'm guessing it cannot be done.

But I was hoping the Stackoverflow coders are smarter and might have an answer? :)

Thanks!

+2  A: 

You can't. Because of browser cross site-scripting security, your bar which sits in its own frame cannot access any other frames and determine their URLs.

Keltex
A: 

Not to mention that'll you'll be sued by website owners for numerous things and that you'll piss off every hacker out there.

This is the last thing you want to do if you'd like to NOT in your our office as that one guy who wanted to include everyone elses web site in their website with the owners permission.

I wouldn't speak up at any of the conventions either.

I've also added the question: "Have you ever written code or worked on code that frames other sites?" to my list of questions to use to weed out job applicants.

there are legitimate uses for this style of iframe
Luke Lowrey