Re: cloneNode in a xpcom component failed

Smaug <[email protected]>
Newsgroups gmane.comp.mozilla.devel.dom
Message-ID <[email protected]>
On 11/28/08 1:34 PM, Sylvain Spinelli wrote:
> 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
Is this a regression? In any case, I think you should file a bug.

-Olli
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.