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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:20:02+00:00 2026-05-28T05:20:02+00:00

I’ve started new extension basing off an older one, which I’ve written earlier and

  • 0

I’ve started new extension basing off an older one, which I’ve written earlier and which is working correctly now. The scheme of doing xhr is pretty normal for Google Chrome extensions: content script calls chrome.extension.sendRequest(data, callback), and the actual cross-site request is done in the backround.html.

Also, I’v made sure that the requested site is added to “permissions” section of manifest.json.

However, console of the background.html displays: “… Origin chrome-extension://.. is not allowed by Access-Control-Allow-Origin.”

The question is the following: except of not having the target domain in the “permissions” (I’ve actually tried even here), WHAT ELSE may cause this error?


Here are some essential code snippets:

manifest.json:

{
    "name": "Register quote",
    "version": "0.0.2",
    "permissions": [ "<all_urls>" ],
    "background_page" : "background.html",
    "content_scripts": [
        {
            "matches": [
                "http://somedomain.com/*"
            ],
            "css": ["register_quote.css"],
            "js": ["jquery-1.3.2.min.js", "register_quote.user.js"]
        }
    ]
}

background.html: http://pastebin.com/0zLArvfA

register_quote.user.js:

// here's the final call, how it's prepared by the content script after all:
chrome.extension.sendRequest({
    'action': 'sendAjaxRequest',
    'url': "http://somedomain.com/the_script.php"
    'dataStr': "is_chrome=Y&ticketid=123123123&user=Vladimir+Mityukov&action=get_quoteids"
}, arg_callback);

P.S.: forgot to mention, there is also the following error in backround.html’s console:

 Error in event handler for 'undefined': TypeError: Cannot read property 'length' of undefined
    at setupPageActionEvents (chrome/ExtensionProcessBindings:424:36)
    at chrome/ExtensionProcessBindings:1021:5
    at [object Object].dispatch (chrome/EventBindings:182:28)
    at Object.<anonymous> (chrome/EventBindings:237:25)

Don’e have any idea what this message means and what part of my code could cause it.. The scripts, mentioned here, are not mine.

  • 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-28T05:20:02+00:00Added an answer on May 28, 2026 at 5:20 am

    This might be caused by some weirdness of the "<all_urls>" pattern, perhaps try changing it to be the specific URL that you want to call:

    See: http://code.google.com/p/chromium/issues/detail?id=87671

    "permissions": [ "http://somedomain.com/*" ]
    

    On a side note, content scripts are now allowed to make cross-origin XHR calls:

    http://code.google.com/chrome/extensions/xhr.html

    “Version note: As of Chrome 13, content scripts can make cross-origin requests to the same servers as the rest of the extension. Before Chrome 13, a content script couldn’t directly make requests; instead, it had to send a message to its parent extension asking the extension to make a cross-origin request.”

    In which case you would need to add http://somedomain.com/ to the permissions list in the manifest.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the

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.