Martin Burchard wrote:
> I tried the example code but it doesn't work for me. I don't understand
> it. Can you please help me to understand what this code does and how I
> can use it.
> I tried this:
> 
> nsIWebNavigation webnav =
> (nsIWebNavigation)window.queryInterface(nsIWebNavigation.NS_IWEBNAVIGATION_IID);
> log.debug(webnav.getClass().getName());
> nsIDocShellTreeNode node =
> (nsIDocShellTreeNode)webnav.queryInterface(nsIDocShellTreeNode.NS_IDOCSHELLTREENODE_IID);
> log.debug(node.getClass().getName());
> log.debug(node.getChildCount());

You need to queryInterface the window to nsIInterfaceRequestor, then 
call getInterface(nsIWebNavigation.NS_IWEBNAVIGATION_IID) on the result, 
then you can call 
queryInterface(nsIDocShellTreeNode.NS_IDOCSHELLTREENODE_IID) on that.
_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom

Reply via email to