Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6125781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:17:15+00:00 2026-05-23T16:17:15+00:00

I am working on a chrome extension that works with the Basecamp API. I

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T16:17:15+00:00Added an answer on May 23, 2026 at 4:17 pm

    I believe I have figured out a solution.

    By using the xmlhttpresponse.setRequestHeader() function, if I manually set the authorization header, it doesnt stay persistent.

    So using this modified version of the above code:

    xmlReq.open(
      'GET', 
      'https://mycompany.basecamphq.com/projects.xml',
       true);
    
    xmlReq.setRequestHeader("Authorization", "Basic "+base64_encode(access_token+":x"));
    
    xmlReq.send(null);
    

    I used the base64_encode function found in the phpjs.org library.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a chrome extension and I have a script that opens a
I'm working on a Chrome/Firefox extension which will be using the file API to
I'm working on a chrome extension that contains all of its functionality in a
I am making a chrome extension and I have a popup.html page that contains
I am working on creating a Google Chrome extension. We have it included in
I'm working on a chrome extension that makes an ajax request for Netflix RSS
I'm working on a chrome extension, which use asynchronous functions, and I have a
I have a working firefox extension that currently consists of a button. When I
I'd like to write a Chrome extension that works with a particular JS-based chat
I'm working on a Chrome extension that injects content into the tumblr 'new posts'

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.