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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:02:36+00:00 2026-05-22T16:02:36+00:00

Firefox has a native notification box system: https://developer.mozilla.org/en/Code_snippets/Alerts_and_Notifications#Using_notification_box I’d like to use this system

  • 0

Firefox has a native notification box system:
https://developer.mozilla.org/en/Code_snippets/Alerts_and_Notifications#Using_notification_box

I’d like to use this system in a way that it appears in all opened tabs when it is supposed to appear. The code I have only warns you in the currently opened tab.

var mainWindow = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIWebNavigation).QueryInterface(Components.interfaces.nsIDocShellTreeItem).rootTreeItem.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIDOMWindow);
var nb = mainWindow.gBrowser.getNotificationBox();
//...
outdatedNotification = nb.appendNotification("Your information outdated",
                                'outdate-warn',
                                'chrome://checksistem/skin/checksistem.png',
                                priority, buttons);
  • 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-22T16:02:37+00:00Added an answer on May 22, 2026 at 4:02 pm

    Each tab has it’s own notification box. You just need to loop over all the browsers and add the notification to each one. One thing you should know is the gBrowser.getNotificationBox can take a browser element:

    http://mxr.mozilla.org/mozilla-central/source/browser/base/content/tabbrowser.xml#337

    If you don’t pass a browser, the code returns the notification box for the active tab.

    Try this:

      var browsers = mainWindow.gBrowser.browsers;
      for (var i=0; i<browsers.length; i++) {
        var nb = mainWindow.gBrowser.getNotificationBox(browsers[i]);
        outdatedNotification = nb.appendNotification("Your information outdated",
                                        'outdate-warn',
                                        'chrome://checksistem/skin/checksistem.png',
                                        priority, buttons);
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Like firefox has firebug as a efficient tool for web application developer, I am
Possible Duplicate: Debugging JavaScript in IE7 Firefox has Web Developer plugin and Firebug for
Firefox has native support for SVG. However, I have a web page where the
Chrome has its developer tools that times ajax latency, firefox has firebug, but what
The problem is as follows. onbeforeunload works like a charm in Firefox and has
Firefox has this nice find-a-text-on-the-page dialog, which is non-modal and shows up at the
Firefox 3 has introduced a new behavior in which line-height, when unset, differs from
I've read that Firefox 3.5 has a new feature in its parser ? Improvements
When a user has several Firefox extensions, what decides the order in which they
If my app has been tested in Firefox 3, Safari 3 & IE 7

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.