>> I am trying to make a program to capture screenshots of web pages based
>> on gtkmozembed and ported GTK library. I need to determine, when all
>> panting is complete. Gtkmozembed provides net_stop signal, which means,
>> that the page has downloaded, but not painted. When I save the
>> screenshot in net_stop handler, some parts of the page is missing. Is
>> there some way to determine, when the page "is ready to be 
>> screenshoted" ?
>>
>> Thanks for any suggestion
> 
> I think that this is still pretty hard to do.  Robert + Dave - we talked 
> about this a bit.  Still a challenge?

I would really like to do it but unfortunately I am a newbie in Mozilla 
API. I tested this code:

-------
nsIWebBrowser *webBrowser;
nsIDOMWindow *domWindow;
gtk_moz_embed_get_nsIWebBrowser(GTK_MOZ_EMBED(browser->mozEmbed), 
&webBrowser);

nsIDOMDocument *domDoc;
nsresult rv;

webBrowser->GetContentDOMWindow(&domWindow);


rv = domWindow->GetDocument(&domDoc);
if (NS_FAILED(rv)) exit(1);

nsCOMPtr<nsIDocument> doc = do_QueryInterface(domDoc);
nsCOMPtr<nsIDOMEventTarget> target(do_QueryInterface(doc));

nsDOMEventListener *listener = new nsDOMEventListener();

rv = target->AddEventListener(NS_LITERAL_STRING("pageload"), listener, 
PR_FALSE);
-------

I expected, that it will call the listener when the pageload event 
occurs but unfortunately it does nothing for any event - I dont 
understand why

I really dont have any other idea how to do it
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding

Reply via email to