[Project_owners] XPCNativeWrapper and nsIDOMNSHTMLDocument object

Didier Ernotte didier at ernotte.com
Thu Aug 4 18:04:33 EDT 2005


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
> 



More information about the Project_owners mailing list