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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:29:50+00:00 2026-05-31T05:29:50+00:00

Manifiest.json { "name":"MyExtension", "version":"1.0", "description":"MyExtension Description.", "icons":{"128":"browseraction.png"}, "browser_action": { "default_icon":"icon.png", "default":"Mi default title", "popup":"popup.html"

  • 0

Manifiest.json

    {
        "name":"MyExtension",
        "version":"1.0",
        "description":"MyExtension Description.",
        "icons":{"128":"browseraction.png"},
        "browser_action":
                        {
                            "default_icon":"icon.png",
                            "default":"Mi default title",
                            "popup":"popup.html"
                        },
        "permissions":[
        "http://*/*",
        "tabs"
        ]
    }

and this is my popup.html

<html>
    <head>
        <script type="text/javascript">     
            var address = "http://www.google.com";
            var xhr = new XMLHttpRequest();
            xhr.onreadystatechange = handleStateChange; 
            xhr.open("GET", chrome.extension.getURL(address), true);//This dont work
           //xhr.open("GET", chrome.extension.getURL('/popup1.html'), true);//thisWork
           xhr.send();
           function handleStateChange()
           {
               if (xhr.readyState == 4) 
               {
            
                  alert(xhr.responseText);
               }
               else
               {
                  alert('Not Yet');
               }
           }
        </script>
    </head>
    <body>

    </body>
</html>

I just want display the html code, with alert
I read,http://code.google.com/chrome/extensions/xhr.html , and other resource but just dont work
Thank in advance

  • 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-31T05:29:50+00:00Added an answer on May 31, 2026 at 5:29 am

    Your code does not work, because chrome.extension.getURL does not work as you expect. For a given string, it attempts to resolve the URL to a local file in the chrome extension.

    When http://www.google.com/ is given as input, www.google.com is returned. The XHR request does not complete because the URI is invalid (the protocol [and path] is missing). Also, both the (browser action) popup and Content scripts are restricted by the cross-origin policy.

    To create cross-domain XHR requests, you have to incorporate a Background page and add the URI in manifest.json, at permissions file.

    A full demo is available in this answer:

    • Cross-domain XMLHttpRequest using background pages
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have problems in chrome-extension API (chrome.webrequest). My manifest.json { name: tesst, version: 1.0,
I have a manifest.json file that looks like this: { name: Zend Debugger Extension,
Manifest: Manifest-Version: 1.0 Bundle-Name: Mahjong Bundle-Activator: MahjongActivator Bundle-SymbolicName: Mahjong Bundle-Version: 1.0.0 Import-Package: org.osgi.framework Compiling
In Chrome extension you take care for the short description in the manifest.json itself
The following manifest is added to my .exe.: <?xml version=1.0 encoding=UTF-8 standalone=yes?> <assembly xmlns=urn:schemas-microsoft-com:asm.v1
This code is being used on a Chrome Extension. When I call the "showOrHideYT()"
Just as the title says: setInterval is only firing its callback once. manifest.json: {
I am creating a Chrome Extension that upon clicking the extension icon will present
I'm making a chrome package app. Here is my manifest.json app: { launch: {
Permissions set in manifest.json don't seem to be affecting my background page. While working

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.