Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Sep 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    permission exception when access to frame content

    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:

    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 ?

  • #2
    Regular Coder martin_narg's Avatar
    Join Date
    Jul 2002
    Location
    Chamonix, France
    Posts
    600
    Thanks
    1
    Thanked 3 Times in 3 Posts
    It is a cross-domain security issue that you are encountering. Try looking into xmlhttp for a cross-domain solution.

    m_n
    "Cos it's strange isn't it. You stand in the middle of a library and go 'Aaaaaaaaaaaaaaaaggggggghhhhhhh!'
    and everybody just stares at you. But you do the same in an aeroplane, and everybody joins in."
    -Tommy Cooper

  • #3
    New to the CF scene
    Join Date
    Sep 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #4
    New to the CF scene
    Join Date
    Sep 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I temporary resolve problem using mozilla user.js file with setting:

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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •