Instantly share code, notes, and snippets.
CreatedOctober 21, 2010 15:07
Save youpy/638634 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
varCc=Components.classes; | |
varCi=Components.interfaces; | |
varobserverService=Cc['@mozilla.org/observer-service;1'].getService(Ci.nsIObserverService); | |
varhttpResponseObserver= | |
{ | |
observe:function(subject,topic,data) | |
{ | |
if(topic=="http-on-examine-response"){ | |
varhttpChannel=subject.QueryInterface(Components.interfaces.nsIHttpChannel); | |
httpChannel.setResponseHeader("Access-Control-Allow-Origin","",false); | |
} | |
} | |
}; | |
observerService.addObserver(httpResponseObserver,'http-on-examine-response',false); |
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment