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

  • Home
  • SEARCH
  • 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 6532331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:59:19+00:00 2026-05-25T09:59:19+00:00

Where I can find an example code of chrome extension which shows the current

  • 0

Where I can find an example code of chrome extension which shows the current address in a popup?

Thanks.
Ron

  • 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-25T09:59:20+00:00Added an answer on May 25, 2026 at 9:59 am

    Documentation: http://code.google.com/chrome/extensions/getstarted.html
    Samples: http://code.google.com/chrome/extensions/samples.html

    This is the official documentation and sample code for Google Chrome extensions. In your manifest you want to declare a popup for either a page or browser action (whichever best suites your extension). In your popup HTML file you probably want something like the following;

    <!DOCTYPE HTML>
    <html>
        <head>
            <script type="text/javascript">
                function initPopup() {
                    chrome.tabs.getSelected(null, function (tab) {
                        document.body.appendChild(document.createTextNode(tab.url));
                    });
                }
            </script>
        </head>
        <body onload="initPopup();"></body>
    </html>
    

    This very simply appends the URL of the selected tab to the body of the popup.

    Your manifest should look like the following;

    {
        "name": "My First Extension",
        "version": "1.0",
        "description": "The first extension that I made.",
        "browser_action": {
            "default_icon": "icon.png",
            "default_popup": "popup.html"
        },
        "permissions": [
            "tabs"
        ]
    }
    

    The file structure for this example is a single folder containing manifest.json, popup.html and icon.png.

    On the Extensions page (chrome://extensions) you should click Load unpacked extension… and navigate to this folder. If you make any changes to the manifest be sure to click the Reload link to pick up these changes.

    I hope this helps but I strongly suggest reading through the documentation I mentioned above to get a better understanding of what you’re doing.

    EDIT: Added missing null argument to code and included an example manifest and file structure based on additional information gathered from comments.

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

Sidebar

Related Questions

I've heard powershell 2.0 CTP has modules, but I can't find much example code
This you can find a Fiddle example, and here is the code : <div
Does anyone know where I can find some example code for implementing ajax tabs
Does anyone know where I can find an example of how to determine if
Does anyone know where I can find an example or a tutorial of building
I'm sure I've done this before, but can't find any example of it! Grrr...
I can find lots of information on how Long Polling works (For example, this
How can I find the largest increasing (non-contiguous) subset of an array? For example,
Here's a PHP example of mine. Can anyone find a shorter/easier way to do
I find it annoying that I can't clear a list. In this example: a

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.