Re: Way to get images inside embed object?



Hi,

Le mercredi 30 novembre 2005 à 00:58 +0900, Kang Jeong-Hee a écrit :
> Image Toolbar the firefox extension is really fancy tool for me.
> I've tried to make it over epiphany-extension system but couldn't do.
> 
> The firefox extension put an event handlers for mouseover and etc.
> But epiphany seems not to provide such an API to connect to embed
> for images (or whatever elements) inside, yet.
> 
> Is this my fault of not enough checkout? How can I get elements
> inside of embed object?

It's a bit complicated unfortunately... pyxpcom will make it easier, but
isn't ready yet :/

First you need to get the DOM document from the embed:

nsCOMPtr<nsIWebBrowser> browser;
gtk_moz_embed_get_nsIWebBrowser (mozembed, getter_AddRefs(browser));
NS_ENSURE_TRUE (mWebBrowser, NS_ERROR_FAILURE);

nsresult rv;
rv = browser->GetContentDOMWindow (getter_AddRefs (mDOMWindow));
NS_ENSURE_SUCCESS (rv, rv);

nsCOMPtr<nsIDOMDocument> domDoc;
rv = mDOMWindow->GetDocument (getter_AddRefs (domDoc));
NS_ENSURE_SUCCESS (rv, rv);

Now you can QI the dom document to nsIDOMNode, nsIDOMElement etc, and
use the DOM functions on it.

Regards,
	Christian




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]