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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:28:56+00:00 2026-05-23T17:28:56+00:00

I have an addon that open a html page when you click a button

  • 0

I have an addon that open a html page when you click a button on the browser bar (so far so good)
in the html page I have this javascript:

    function new_version_show_window()
        {
            if (prefManager.getCharPref("extensions.mf_unblocker.blocker_version_in_prefs") != this_version)
            {


                gBrowser.selectedTab = gBrowser.addTab("http://mfre.com/mf/new_install_'+this_version+'.html");    
            }
        }

But I am getting the error:

gBrowser is undefined

The javascript is in

chrome://mf_unblocker/content/0_register.html

so I am very much still in the browser extension
how do i get it to open a new tab?

Thanks!
Ryan

  • 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-23T17:28:57+00:00Added an answer on May 23, 2026 at 5:28 pm

    Try this:

    var win = Components.classes['@mozilla.org/appshell/window-mediator;1']
                      .getService(Components.interfaces.nsIWindowMediator)
                      .getMostRecentWindow('navigator:browser');
                    win.gBrowser.selectedTab = win.gBrowser.addTab(url);
    

    Assuming url is the URL to be opened

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

Sidebar

Related Questions

I have a simple addon that adds a button to toolbar. I want this
I have a button on a web page that when clicked connects to my
I'm using this javascript code in firefox addon: window.open(link); It opens a link in
There is an open source firefox addon that I have attempted to test with
In my firefox addon. I have two tabs open in my browser, when I
I have a Java project that needs a addon interface. I was thinking about
NOTE: This is the simple version of my previous question that SHOULD have been
i analyzed a page that i'm working on with live http headers addon for
I have been looking round for an open-source CMS framework that I can use
I have an addon that every 5 minuets or so checks an rss feed

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.