Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Accessing XUL anonymous content using C++

5 views
Skip to first unread message

Vaibhav

unread,
Apr 7, 2010, 12:10:53 AM4/7/10
to
Hi All,

I am writing Firefox extension using C++.
I am trying to access XUL:tabox element in "TabOpen" event handler,
but I am unable access any XUL element.

I am putting here pseudocode of my extension for reference:

HandleEvent()
{
if (event type is TabOpen)
{
nsCOMPtr<nsIDOMNode> OriginalNode = do_QueryInterface(event-
>GetTarget);
nsCOMPtr<nsIDOMNodeList> childlist;

//
// Note here that I got OriginalNode's local name as
"tabbrowser"
//

OriginalNode->GetChildNodes(getter_AddRefs(childlist));
PRUint32 len;
childlist->GetLength(&len); // Return 1; consider only "popup" child
element.

nsString localName;
nsCOMPtr<nsIDOMNode> node1;
childlist->Item(0, getter_AddRefs(node1));
node1->GetLocalName(localName); // Returns "popup" as the local
name.
}
}


By traversing the DOM tree through DOM Inspector, I came to know that
XUL elements are anonymous content.

How do I access these XUL elements?

Very Thanks in advance,

Vaibhav.

Ralph Fox

unread,
Apr 7, 2010, 8:25:35 AM4/7/10
to
On Tue, 6 Apr 2010 21:10:53 -0700 (PDT), in message <00a76ff1-1222-4799...@z7g2000yqb.googlegroups.com>
Vaibhav <vaibh...@gmail.com> wrote:

> Hi All,
>
> I am writing Firefox extension using C++.
> I am trying to access XUL:tabox element in "TabOpen" event handler,
> but I am unable access any XUL element.

Everyone has moved to the mozilla.* newsgroups hosted on the news.mozilla.org news server.
I suggest that you ask your question there.


See this message: http://groups.google.com/group/netscape.public.mozilla.dom/msg/3a433f9688bca2d9
and this message: http://groups.google.com/group/netscape.public.mozilla.dom/msg/bfa8b640bfaee985


0 new messages