Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

90
Views
Firefox Extension | Set BadgeText to Browser.History GetVisits

I am trying to write a very simple extension for Firefox that shows an Icon Notifier in to Toolbar displaying the number of items I have visited the current website.

So far, I have set up a very simple manifest.json, which basically just creates the extension and an icon in the toolbar.

{

 "description": "Count the visits for the current website",
 "manifest_version": 2,
 "name": "CounttheVisits",
   "icons": {
   "48": "beasts-32.png"
 },
 "permissions": [
   "tabs"
 ],
 "version": "1.0",
 "browser_action": {
   "browser_style": true
 },
 "background": {
     "scripts": ["background.js"]
 }

}

Now I understand that I would have to add browserAction.setBadgeText() to the background.js and set it to take the value for number of visits from my browser history.

My best guess is something along the lines of:

var visits = browser.history.getVisits();
browser.browserAction.setBadgeText({text: (++visits).toString()});

But I am sure I am missing something - can anyone of you help? Much appreciated :)

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!