xul browser (sort of iframe) how to get the contained document

View: New views
2 Messages — Rating Filter:   Alert me  

xul browser (sort of iframe) how to get the contained document

by N3O :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm working on an application built using XUL.

Development is using a iframe with a nested browser, now i can get the document of the first iframe. however I'm unable to get the content of the 'browser' element, can any one explain me how this could be done?

Kind Regards,
  N3O

Re: xul browser (sort of iframe) how to get the contained document

by Dean Bayley :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


To get the innerHTML of the currently loaded page in the xul window element use: document.getElementById("browser").contentDocument.documentElement.innerHTML

To get the innerHTML of iframe inside the currently loaded page in the xul window element use:
document.getElementById("browser").contentDocument.getElementById('iframe_id_here').contentDocument.documentElement.innerHTML

HTH.
D.