cloneNode in a xpcom component failed
Sylvain Spinelli <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.dom |
|---|---|
| Organization | http://groups.google.com |
| Message-ID | <[email protected]> |
Hi,
Context : 1.9.1 recent build, windows
// In a JS component, I load a DOM (from chrome://)
var vXhrComp = Components.classes["@mozilla.org/xmlextras/
xmlhttprequest;1"];
var vReq = vXhrComp.createInstance
(Components.interfaces.nsIXMLHttpRequest);
vReq.open("GET", "chrome://mychrome/content/myFile.xml", false);
vReq.send(null);
var vXml = vReq.responseXML;
//I want to "backup" my dom
var vXmlBackup = vXml.cloneNode(true);
The cloneNode failed : Security Error: Content at moz-nullprincipal:
{c0db3ee1-d7c3-47e4-b6d9-0a08830f15c9} may not load or link to //
chrome://mychrome/content/myFile.xml.
I think it's a problem with transfering nsIPrincipal to the new
Document.
In a xul page in chrome, this code works fine.
I miss something ? Is there a way to declare the nsIPrincipal ?
Do you think I should file a bug ?
Thanks,
Sylvain