I have some problems with the Xul <browser>, which is placed inside a
<window>. I have to render web pages from HTMLObjects. At the moment
the HTMLObject is put directly in the innerHTML of the <browser> (not
sure this is the right way...). Also the browser's src-attribute is
set to the displayed URL.
The <browser> obviously loads the URL from the src-attribute, whicht
should never happen. I could leave the src empty but then I have to
fix the relative links. (It's nice to avoid fixing the links... )
Is there an easy way to display and rendered HTML-code dynamically in
Firefox/Mozilla with XUL? And if so: Do I have to fix the links?
Hope my explainations aren't to short. I'm new to Xul and sadly
couldn't figure it out myself. I'm going to try the porgress listeners
(https://developer.mozilla.org/en/Code_snippets/Progress_Listeners)
but I hope there's another way because (if I'm correct here) the
listeners trigger when loading the page (or at least after the request
is send), which I want to avoid.
Cheers,
Sebastian
mainBrowser.webNavigation.loadURI(src,
nsIWebNavigation.LOAD_FLAGS_STOP_CONTENT, null, null, null);
mainBrowser.addEventListener("load", function () {
mainBrowser.contentDocument.wrappedJSObject.getElementsByTagName
('html')[0].innerHTML = webContent;
}, true);
I got one last question: the flag is set to "stop content" and I hoped
that it would stop the web page content from loading completly. But it
doesn't...
If the added event listener does nothing the web page is loaded
anyway... Why is that? Can't I set the URI without loading the page
content? :(
Cheers,
Sebastian