View Full Version : permission exception when access to frame content

09-25-2005, 12:06 PM
I need my script to analyze some external web page content

I use iframe to load this page and try to get content by this code:

var iframe = document.getElementById("loadFrame");

var text = iframe.contentWindow.document.body.innerHTML;

And I get exception "Error: uncaught exception: Permission denied to get property HTMLDocument.body" in Firefox Browser.

How i can bypass this problem ?

Or what another way to get content of external page ?

09-25-2005, 01:29 PM
It is a cross-domain security issue that you are encountering. Try looking into xmlhttp (http://www.w3schools.com/xml/xml_http.asp) for a cross-domain solution.


09-25-2005, 03:38 PM
Thank you for this usefull link. I found many intresting things on it.

But XMLHTTP solution works only on my IE6.
On Firefox i have permission exception again, when i use external link.

Maybe firefox have settings to switch off permission ?

Probably I will have to back to php and socket's for getting content.

This needs a local web server but i want standalone page.

Also, some pages have https protocol and I don't want to implement it in php code.

09-25-2005, 04:08 PM
I temporary resolve problem using mozilla user.js file with setting:

user_pref("capability.policy.default.XMLHttpRequest.open", "allAccess");