Skip to content

Instantly share code, notes, and snippets.

@jayfresh
Created September 14, 2010 23:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jayfresh/579936 to your computer and use it in GitHub Desktop.
Save jayfresh/579936 to your computer and use it in GitHub Desktop.
diff --git a/socket.io.js b/socket.io.js
index dfd777a..6185082 100644
--- a/socket.io.js
+++ b/socket.io.js
@@ -329,6 +329,12 @@ if (typeof window != 'undefined') this.io.setPath('/socket.io/');
XHR.prototype._request = function(url, method, multipart){
var req = request(this.base._isXDomain());
if (multipart) req.multipart = true;
+
+ // JRL: adding this to enable cross-browser XHR in FF
+ if(window.Components && window.netscape && window.netscape.security && document.location.protocol.indexOf("http") == -1) {
+ window.netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
+ }
+
req.open(method || 'GET', this._prepareUrl() + (url ? '/' + url : ''));
if (method == 'POST' && 'setRequestHeader' in req){
req.setRequestHeader('Content-type', 'application/x-www-form-urlencoded; charset=utf-8');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment