Posted on stackoverflow as well:
http://stackoverflow.com/questions/6598895/xmlhttprequest-in-chrome-extension-with-http-authorization-continues-to-send-auth
I am working on a chrome extension that works with the Basecamp API.
I have a background page doing all my XMLHttpRequests to the API. I'm
not using OAuth, but the basic HTTP Authorization with the API Token.
In my background page, I will do requests like this:
var xmlReq = new XMLHttpRequest();
xmlReq.onreadystatechange = function()
{ doSomething(xmlReq.responseXML); };
xmlReq.open(
'GET',
'
https://mycompany.basecamphq.com/projects.xml',
true,
access_token,
'x'
);
xmlReq.send(null);
That all works fine, but the problem is after I use the extension to
make a request, the HTTP Request header Authorization is being sent
whenever I browse to
https://mycompany.basecamphq.com, which make
certain things not work on Basecamp's web interface. How can I make a
request in my extension with basic HTTP Authorization but not have the
header in my regular browser requests?
Yeah, confusing question. I'll try to clarify it if you have
questions. Thanks