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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:32:36+00:00 2026-06-05T07:32:36+00:00

I’m try to develop a simple google chrome extension. What it does it that

  • 0

I’m try to develop a simple google chrome extension. What it does it that it displays the number of downloads on a page (the count) and display it in a popup.

The page in question that needs monitoring is a page which can only be acessed after logged in.

So I need to basically use html and javascript to ‘scrap’ the count number from the page and display it in a popup. So far I have created the barebones of the exntension:

{
  "name": "Downloads Logger",
  "version": "1.0",
  "manifest_version": 2,
  "description": "Monitors Number Of Downloads",
  "browser_action": {
    "default_icon": "icon.png"
  },
  "permissions": [
    "http://exampledownloadpage.com/loggedin/"
  ]
}

What do I do next? Do I need a background page for the extension? I have read up the extensions documentation and unpacked the official gmail extension and try seeing how it works, but it seems to make use of ‘feeds’ to get it’s data. Can anybody point me in the right direction? Thank you 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-06-05T07:32:37+00:00Added an answer on June 5, 2026 at 7:32 am

    If you only want to display the number of downloads in a browser_action then you shouldnt need a background page, but if you wanted to monitor the amount of downloads every minute or so then you would.
    To get the download count you could use XMLHttpRequest to download the pages source, then parse it to a dom using…..

    var page = document.implementation.createHTMLDocument("");
    page.documentElement.innerHTML = pageSource;  // assuming the source for the page you downloaded with httprequest is in pageSource
    

    …and then you could use something like querySelector to get the text of the bit of the page your intesersted in, something like…..

    downloadstats = page.querySelector('.downloadstats').textContent.trim();
    

    Hopefully that’ll get you started.

    Here’s a simple (no error checking or what not) example that gets your rep points from stackoverflow…..

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = function() {
        if (this.readyState == 4) {
            var page = document.implementation.createHTMLDocument("");
            page.documentElement.innerHTML = this.responseText;
            var score = page.querySelector('[title^="your reputation;"]').textContent.trim();
            alert('You have ' + score + ' rep points.');
        }
    }
    xmlhttp.open("GET", "http://stackoverflow.com", true);
    xmlhttp.send();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making a simple page using Google Maps API 3. My first. One marker
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has

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.