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 7720033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T03:33:46+00:00 2026-06-01T03:33:46+00:00

I am writing codes for a Chrome extension that needs to access minus.com, which

  • 0

I am writing codes for a Chrome extension that needs to access minus.com, which uses oAuth 2.0 for authentication, so I wrote a javascript file ‘test.js’, then included it in a HTML file ‘test.html’, then load ‘test.html’ in Chrome to test the javascript codes, which is used for the authentication.

The structure of the ‘test.js’ looks like this:

function Ajax(url, options) {

// some function content

    // Sending data
    if (options.method === "POST" && (options.params || options.binaryData)) {
        if (options.binaryData) {
            xhr.sendAsBinary(options.binaryData);
        } else {
            xhr.send(hashToQueryString(options.params));
        }
    } else {
        xhr.send(null);
    }

    return xhr;
}

function refreshToken(refresh_token) {
    var params = {
        'grant_type': 'refresh_token',
        'client_id': API_KEY,
        'client_secret': API_SECRET,
        'refresh_token': refresh_token,
        'scope': 'read_all modify_all upload_new'
    }

    new Ajax("https://minus.com/oauth/token", {
        params: params,

        onSuccess: function(response) {
            console.log(response.access_token);
        },

        onError: function(response) {
            console.log('error: wrong_token');
        }
    });               
}

refreshToken();

When I loaded the ‘test.html’ in Chrome to test ‘test.js’, it prompted an error in the console, saying “XMLHttpRequest cannot load https://minus.com/oauth/token?… Origin file:// is not allowed by Access-Control-Allow-Origin.” I have tried to launch Chrome with the option “–allow-file-access-from-files” or “–disable-web-security”, but it didn’t solve the problem. However, if I commented the “Sending data” part in the “Ajax”function, there is no error.

Does anyone have ideas what’s going on here?

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-06-01T03:33:47+00:00Added an answer on June 1, 2026 at 3:33 am

    You solve it by making your application a packaged application which does support cross domain calls. Hosted applications do not.

    You may also want to read Cross-Origin XMLHttpRequest in chrome extensions

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

Sidebar

Related Questions

I'm writing a Chrome extension that needs to maintain a list of <object> and
I'm writing a chrome extension which needs to interact with a subtree of bookmarks.
I'm writing a google chrome extension that uses chrome.pageCapture.saveAsMHTML(object details, function callback) function callback
[I'm a YUI newbie] I'm writing a Chrome extension that needs to change the
I'm writing a Chrome extension that works with a website that uses ISO-8859-1. Just
I am writing a browser extension that needs to attach handlers to the keyup
I'm writing a Google Chrome extension. As the JavaScript files are loaded from disk,
I am writing an extension for Google Chrome. The content script never sees that
I'm writing a Chrome browser extension that takes a snapshot of the current tab's
I am writing a Chrome extension that synchronizes with Opera Link, but I keep

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.