I am using using  GtkMozEmbed for the SashXB project and am attempting to
insert a new toplevel object into Javascript. We can do that just fine.
The only issue is getting to the Javascript context after the document has
been created but before the javascript has started to execute.

The current way we've been doing this is to use GtkMozEmbed's "progress"
signal, which is called from nsIWebProgressListener::OnProgressChange.
This is the only signal we could find which is called after the document
has been created but before the javascript executes. It's also a bit of a
hack. Unfortunately, it is not a universally applicable hack, since the
file:// protocol never calls progress (at least not in my tests). This
isn't a great way of doing things anyway.

The other option I thought of was loading about:blank, adding the object,
then loading the real page, since about:blank does not clear the js scope
when it loads. This is an even worse hack, and it doesn't work anyway.

I've tried catching different things in nsIWebProgressListener, thinking
perhaps some STATE_IS_DOCUMENT-oriented things might be helpful. Alas,
they are not.

So, my question: Is there any way for an embedder to get to the nsDocument
after it has been created but before it's finally set loose to execute
javascript?

Thanks,
Andrew

Reply via email to