[Project_owners] XPCNativeWrapper and nsIDOMNSHTMLDocument object

Eric Jung grimholtz at yahoo.com
Thu Aug 4 20:36:30 EDT 2005


What if you continue to use DOM methods to add content to doc; i.e.,

var br = document.createElement("browser");
someObject.appendChild(br);
var doc = br.contentDocument;
var htmlElem = document.createElement("html");
var bodyElem = document.createElement("body");
var embedElem = document.createElement("embed");
htmlElem.appendChild(bodyElem);
bodyElem.appendChild(embedElem);
doc.appendChild(htmlElem);

Haven't tried it, but maybe it would work?

-eric

--- Didier Ernotte <didier at ernotte.com> wrote:

> Ok, back to the begining. In my extension, I have to dynamicaly
> create
> a <browser> and then populate the content with a dynamic string
> like
> "<html><body><embed.....></embed></body></html>".
> In Firefox 1.0.6, I use:
> 
> var br = document.createElement("browser");
> someObject.appendChild(br);
> var doc = br.contentDocument;
> doc.write("<HTML><BODY><EMBED.....></embed></body></html>");
> 
> 
> but this doesn't work with firefox 1.1. I have an
> (NS_ERROR_INVALID_POINTER) [nsIDOMNSHTMLDocument.write...)
> exception.
> 
> What I have read (but I may be wrong) is that , with firefox 1.1, I
> have to use:
> 
> var br = document.createElement("browser");
> someObject.appendChild(br);
> var contentWrapper = new XPCNativeWrapper(br.contentWindow,
> 'document');
> var docWrapper = new XPCNativeWrapper(contentWrapper.document, '',
> 'write()');
> docWrapper.write("<HTML><BODY><EMBED.....></embed></body></html>");
> 
> but it doesn't work either.
> 
> Didier
> 
> --- Neil <neil at parkwaycc.co.uk> wrote:
> 
> > Didier Ernotte wrote:
> > 
> > >There is no javascript in it.
> > >  
> > >
> > So where do the XPCNativeWrappers fit in?
> > _______________________________________________
> > Project_owners mailing list
> > Project_owners at mozdev.org
> > http://mozdev.org/mailman/listinfo/project_owners
> > 
> 
> _______________________________________________
> Project_owners mailing list
> Project_owners at mozdev.org
> http://mozdev.org/mailman/listinfo/project_owners
> 



		
__________________________________ 
Yahoo! Mail for Mobile 
Take Yahoo! Mail with you! Check email on your mobile phone. 
http://mobile.yahoo.com/learn/mail 


More information about the Project_owners mailing list