<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Cross Domain XHR with Firefox</title>
	<atom:link href="http://www.zachleat.com/web/2007/08/30/cross-domain-xhr-with-firefox/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zachleat.com/web/2007/08/30/cross-domain-xhr-with-firefox/</link>
	<description></description>
	<pubDate>Thu, 21 Aug 2008 10:25:47 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
		<item>
		<title>By: Zach Leatherman</title>
		<link>http://www.zachleat.com/web/2007/08/30/cross-domain-xhr-with-firefox/#comment-835</link>
		<dc:creator>Zach Leatherman</dc:creator>
		<pubDate>Tue, 12 Aug 2008 13:19:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachleat.com/web/2007/08/30/cross-domain-xhr-with-firefox/#comment-835</guid>
		<description>Never say die.

http://developer.mozilla.org/en/docs/Cross-Site_XMLHttpRequest

Looks like you could make a plugin that enables this for the web :)  Have at it!</description>
		<content:encoded><![CDATA[<p>Never say die.</p>
<p><a href="http://developer.mozilla.org/en/docs/Cross-Site_XMLHttpRequest" rel="nofollow">http://developer.mozilla.org/en/docs/Cross-Site_XMLHttpRequest</a></p>
<p>Looks like you could make a plugin that enables this for the web :)  Have at it!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sean</title>
		<link>http://www.zachleat.com/web/2007/08/30/cross-domain-xhr-with-firefox/#comment-834</link>
		<dc:creator>Sean</dc:creator>
		<pubDate>Tue, 12 Aug 2008 12:31:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachleat.com/web/2007/08/30/cross-domain-xhr-with-firefox/#comment-834</guid>
		<description>I've read that the above technique will not work under Firefox 3. My tests seem to confirm this. And, there's this thread:

http://groups.google.com/group/mozilla.dev.apps.firefox/browse_thread/thread/0b3db90e1b452f33/d4fd6124df529739

So, is it game over?</description>
		<content:encoded><![CDATA[<p>I&#8217;ve read that the above technique will not work under Firefox 3. My tests seem to confirm this. And, there&#8217;s this thread:</p>
<p><a href="http://groups.google.com/group/mozilla.dev.apps.firefox/browse_thread/thread/0b3db90e1b452f33/d4fd6124df529739" rel="nofollow">http://groups.google.com/group/mozilla.dev.apps.firefox/browse_thread/thread/0b3db90e1b452f33/d4fd6124df529739</a></p>
<p>So, is it game over?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mark</title>
		<link>http://www.zachleat.com/web/2007/08/30/cross-domain-xhr-with-firefox/#comment-823</link>
		<dc:creator>mark</dc:creator>
		<pubDate>Wed, 09 Jul 2008 18:46:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachleat.com/web/2007/08/30/cross-domain-xhr-with-firefox/#comment-823</guid>
		<description>hi board!

y have this error, 
Permiso para obtener la propiedad Element.childNodes denegado

in english
Permission denied to get property Element.childNodes

and i create prefs.js file, and i have this error yet... i am using V 3.0

tks for u help.</description>
		<content:encoded><![CDATA[<p>hi board!</p>
<p>y have this error,<br />
Permiso para obtener la propiedad Element.childNodes denegado</p>
<p>in english<br />
Permission denied to get property Element.childNodes</p>
<p>and i create prefs.js file, and i have this error yet&#8230; i am using V 3.0</p>
<p>tks for u help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zach Leatherman</title>
		<link>http://www.zachleat.com/web/2007/08/30/cross-domain-xhr-with-firefox/#comment-818</link>
		<dc:creator>Zach Leatherman</dc:creator>
		<pubDate>Wed, 18 Jun 2008 23:24:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachleat.com/web/2007/08/30/cross-domain-xhr-with-firefox/#comment-818</guid>
		<description>Sure, this method is a client-side only solution.  It's fairly trivial (and common) to use a server side language to act as a proxy for your ajax calls.</description>
		<content:encoded><![CDATA[<p>Sure, this method is a client-side only solution.  It&#8217;s fairly trivial (and common) to use a server side language to act as a proxy for your ajax calls.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arian Hojat</title>
		<link>http://www.zachleat.com/web/2007/08/30/cross-domain-xhr-with-firefox/#comment-817</link>
		<dc:creator>Arian Hojat</dc:creator>
		<pubDate>Wed, 18 Jun 2008 15:37:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachleat.com/web/2007/08/30/cross-domain-xhr-with-firefox/#comment-817</guid>
		<description>Heard this was a viable production solution:
use php to pull the xml, and feed it into the javascript.

http://www.phpfour.com/blog/2008/03/06/cross-domain-ajax-using-php/</description>
		<content:encoded><![CDATA[<p>Heard this was a viable production solution:<br />
use php to pull the xml, and feed it into the javascript.</p>
<p><a href="http://www.phpfour.com/blog/2008/03/06/cross-domain-ajax-using-php/" rel="nofollow">http://www.phpfour.com/blog/2008/03/06/cross-domain-ajax-using-php/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zach Leatherman</title>
		<link>http://www.zachleat.com/web/2007/08/30/cross-domain-xhr-with-firefox/#comment-779</link>
		<dc:creator>Zach Leatherman</dc:creator>
		<pubDate>Sat, 10 May 2008 19:10:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachleat.com/web/2007/08/30/cross-domain-xhr-with-firefox/#comment-779</guid>
		<description>Also, please keep in mind that this is NOT a production solution.  It's a development solution for individual development machines.</description>
		<content:encoded><![CDATA[<p>Also, please keep in mind that this is NOT a production solution.  It&#8217;s a development solution for individual development machines.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zach Leatherman</title>
		<link>http://www.zachleat.com/web/2007/08/30/cross-domain-xhr-with-firefox/#comment-776</link>
		<dc:creator>Zach Leatherman</dc:creator>
		<pubDate>Sat, 10 May 2008 04:25:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachleat.com/web/2007/08/30/cross-domain-xhr-with-firefox/#comment-776</guid>
		<description>Dude, what?

To me that says:
I can parse an XML document.
OR if I can't, try a new way.

That doesn't have anything to do with XHR, other than supplying using it to supply an XML document.</description>
		<content:encoded><![CDATA[<p>Dude, what?</p>
<p>To me that says:<br />
I can parse an XML document.<br />
OR if I can&#8217;t, try a new way.</p>
<p>That doesn&#8217;t have anything to do with XHR, other than supplying using it to supply an XML document.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy</title>
		<link>http://www.zachleat.com/web/2007/08/30/cross-domain-xhr-with-firefox/#comment-775</link>
		<dc:creator>Jeremy</dc:creator>
		<pubDate>Fri, 09 May 2008 23:58:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachleat.com/web/2007/08/30/cross-domain-xhr-with-firefox/#comment-775</guid>
		<description>If you want to ensure that what you are developing works for other users who will not want to do this to their firefox use this:

try{
// IE understands this
    var xml = $(response.responseXML)
    var codes = xml.documentElement.getElementsByTagName("code")
}catch(e){
//firefox understands this
    try{
        var xml = (new DOMParser()).parseFromString( response.responseXML, "text/xml");
        var codes = xml.documentElement.getElementsByTagName("code")
    }catch(ee){       
    }
}</description>
		<content:encoded><![CDATA[<p>If you want to ensure that what you are developing works for other users who will not want to do this to their firefox use this:</p>
<p>try{<br />
// IE understands this<br />
    var xml = $(response.responseXML)<br />
    var codes = xml.documentElement.getElementsByTagName(&#8221;code&#8221;)<br />
}catch(e){<br />
//firefox understands this<br />
    try{<br />
        var xml = (new DOMParser()).parseFromString( response.responseXML, &#8220;text/xml&#8221;);<br />
        var codes = xml.documentElement.getElementsByTagName(&#8221;code&#8221;)<br />
    }catch(ee){<br />
    }<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christian Fecteau</title>
		<link>http://www.zachleat.com/web/2007/08/30/cross-domain-xhr-with-firefox/#comment-571</link>
		<dc:creator>Christian Fecteau</dc:creator>
		<pubDate>Sat, 16 Feb 2008 03:54:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachleat.com/web/2007/08/30/cross-domain-xhr-with-firefox/#comment-571</guid>
		<description>Problem solved. A Firefox search engine xml file has been made for this dictionnary (and more):
http://www.cnrtl.fr/portail/#footerright</description>
		<content:encoded><![CDATA[<p>Problem solved. A Firefox search engine xml file has been made for this dictionnary (and more):<br />
<a href="http://www.cnrtl.fr/portail/#footerright" rel="nofollow">http://www.cnrtl.fr/portail/#footerright</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christian Fecteau</title>
		<link>http://www.zachleat.com/web/2007/08/30/cross-domain-xhr-with-firefox/#comment-555</link>
		<dc:creator>Christian Fecteau</dc:creator>
		<pubDate>Sun, 10 Feb 2008 22:30:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.zachleat.com/web/2007/08/30/cross-domain-xhr-with-firefox/#comment-555</guid>
		<description>Shaun or Zach, how would I do the same for UniversalXPConnect? I'm trying to make myself a Firefox favelet that would search this French dictionnary automatically with my clipboard text:
http://atilf.atilf.fr/dendien/scripts/tlfiv4/showps.exe?p=combi.htm

I'm so close but I'm still getting this error:
&lt;code&gt;uncaught exception: Un script de « http://atilf.atilf.fr » s'est vu refuser des privilèges UniversalXPConnect.&lt;/code&gt;

I've tried these with no luck in user.js:
&lt;code&gt;user_pref("capability.principal.codebase.p0.granted", "UniversalXPConnect");
user_pref("capability.principal.codebase.p0.id", "http://atilf.atilf.fr");
user_pref("capability.principal.codebase.p0.subjectName", "");

user_pref("capability.principal.codebase.p1.granted", "UniversalXPConnect");
user_pref("capability.principal.codebase.p1.id", "http://dell");
user_pref("capability.principal.codebase.p1.subjectName", "");

user_pref("capability.policy.policynames", "allowclipboard");
user_pref("capability.policy.allowclipboard.sites", "file:// http://dell http://atilf.atilf.fr");
user_pref("capability.policy.allowclipboard.Clipboard.cutcopy", "allAccess");
user_pref("capability.policy.allowclipboard.Clipboard.paste", "allAccess");

/*
user_pref("capability.policy.allowclipboard.UniversalXPConnect.QueryInterface", "allAccess");
user_pref("capability.policy.allowclipboard.UniversalXPConnect.createInstance", "allAccess");
user_pref("capability.policy.allowclipboard.UniversalXPConnect.equals", "allAccess");
user_pref("capability.policy.allowclipboard.UniversalXPConnect.getService", "allAccess");
user_pref("capability.policy.allowclipboard.UniversalXPConnect.initialize", "allAccess");
*/
&lt;/code&gt;

and my favelet:
&lt;code&gt;function getClipboardText() {

	if (window.clipboardData) // IE
		return (window.clipboardData.getData('Text'));

	if (!window.netscape) // promt for text if not Mozilla
		return prompt();

	// ask permission to Mozilla
	netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');

	// go on with XUL code
	var	clip = Components
			.classes['@mozilla.org/widget/clipboard;1']
			.createInstance(Components.interfaces.nsIClipboard),
		trans = Components
				.classes['@mozilla.org/widget/transferable;1']
				.createInstance(Components.interfaces.nsITransferable),
		str = {},
		len = {};

	trans.addDataFlavor('text/unicode');
	clip.getData(trans, clip.kGlobalClipboard);
	trans.getTransferData('text/unicode', str, len);

	str =	Components.interfaces.nsISupportsWString
		? str.value.QueryInterface(Components.interfaces.nsISupportsWString)
		: str.value.QueryInterface(Components.interfaces.nsISupportsString);

	return(str.data.substring(0, len.value / 2));
}

var clip = getClipboardText();

console.log(clip);

//document.form1.elements.mot.value = clip;

//verif1();&lt;/code&gt;

Thanks for the XHR code. I've added it to my FF dev profile. Now I can code cross-domain ajax.</description>
		<content:encoded><![CDATA[<p>Shaun or Zach, how would I do the same for UniversalXPConnect? I&#8217;m trying to make myself a Firefox favelet that would search this French dictionnary automatically with my clipboard text:<br />
<a href="http://atilf.atilf.fr/dendien/scripts/tlfiv4/showps.exe?p=combi.htm" rel="nofollow">http://atilf.atilf.fr/dendien/scripts/tlfiv4/showps.exe?p=combi.htm</a></p>
<p>I&#8217;m so close but I&#8217;m still getting this error:<br />
<code>uncaught exception: Un script de « <a href="http://atilf.atilf.fr" rel="nofollow">http://atilf.atilf.fr</a> » s&#8217;est vu refuser des privilèges UniversalXPConnect.</code></p>
<p>I&#8217;ve tried these with no luck in user.js:<br />
<code>user_pref("capability.principal.codebase.p0.granted", "UniversalXPConnect");<br />
user_pref("capability.principal.codebase.p0.id", "http://atilf.atilf.fr");<br />
user_pref("capability.principal.codebase.p0.subjectName", "");</p>
<p>user_pref("capability.principal.codebase.p1.granted", "UniversalXPConnect");<br />
user_pref("capability.principal.codebase.p1.id", "http://dell");<br />
user_pref("capability.principal.codebase.p1.subjectName", "");</p>
<p>user_pref("capability.policy.policynames", "allowclipboard");<br />
user_pref("capability.policy.allowclipboard.sites", "file:// <a href="http://dell" rel="nofollow">http://dell</a> <a href="http://atilf.atilf.fr" rel="nofollow">http://atilf.atilf.fr</a>&#8220;);<br />
user_pref(&#8221;capability.policy.allowclipboard.Clipboard.cutcopy&#8221;, &#8220;allAccess&#8221;);<br />
user_pref(&#8221;capability.policy.allowclipboard.Clipboard.paste&#8221;, &#8220;allAccess&#8221;);</p>
<p>/*<br />
user_pref(&#8221;capability.policy.allowclipboard.UniversalXPConnect.QueryInterface&#8221;, &#8220;allAccess&#8221;);<br />
user_pref(&#8221;capability.policy.allowclipboard.UniversalXPConnect.createInstance&#8221;, &#8220;allAccess&#8221;);<br />
user_pref(&#8221;capability.policy.allowclipboard.UniversalXPConnect.equals&#8221;, &#8220;allAccess&#8221;);<br />
user_pref(&#8221;capability.policy.allowclipboard.UniversalXPConnect.getService&#8221;, &#8220;allAccess&#8221;);<br />
user_pref(&#8221;capability.policy.allowclipboard.UniversalXPConnect.initialize&#8221;, &#8220;allAccess&#8221;);<br />
*/<br />
</code></p>
<p>and my favelet:<br />
<code>function getClipboardText() {</p>
<p>	if (window.clipboardData) // IE<br />
		return (window.clipboardData.getData('Text'));</p>
<p>	if (!window.netscape) // promt for text if not Mozilla<br />
		return prompt();</p>
<p>	// ask permission to Mozilla<br />
	netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');</p>
<p>	// go on with XUL code<br />
	var	clip = Components<br />
			.classes['@mozilla.org/widget/clipboard;1']<br />
			.createInstance(Components.interfaces.nsIClipboard),<br />
		trans = Components<br />
				.classes['@mozilla.org/widget/transferable;1']<br />
				.createInstance(Components.interfaces.nsITransferable),<br />
		str = {},<br />
		len = {};</p>
<p>	trans.addDataFlavor('text/unicode');<br />
	clip.getData(trans, clip.kGlobalClipboard);<br />
	trans.getTransferData('text/unicode', str, len);</p>
<p>	str =	Components.interfaces.nsISupportsWString<br />
		? str.value.QueryInterface(Components.interfaces.nsISupportsWString)<br />
		: str.value.QueryInterface(Components.interfaces.nsISupportsString);</p>
<p>	return(str.data.substring(0, len.value / 2));<br />
}</p>
<p>var clip = getClipboardText();</p>
<p>console.log(clip);</p>
<p>//document.form1.elements.mot.value = clip;</p>
<p>//verif1();</code></p>
<p>Thanks for the XHR code. I&#8217;ve added it to my FF dev profile. Now I can code cross-domain ajax.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
