tags:

views:

148

answers:

3

Hi

Is there a way to remove script from site in frame from other domain?

+4  A: 

No. The some-origin policy means that code in your page can't access the DOM of the page within the frame if it's from another domain.

If the page within the frame is a page that you control (i.e. both domains are yours) you could, I guess, set that page up so that if a certain querystring were added to the URL, the script would be removed on the server-side. But I'm guessing it's not a page you control.

JacobM
A: 

No, but you can use a proxy to load the content from the other domain and re-serve it from your own (with script removed). I presume you're talking about content that you don't control. (Keep in mind that this may or may not be ethical, depending on the content licensing.)

Anirvan
A: 

There is in IE:

<iframe security="restricted" />

But it's generally considered a broken security mechanism and you certainly can't rely on it.

bobince