Firefox M



Firefox mobile

The command line interpreter gets access to the tabbrowser object, through the gBrowser global, and that enables you to control the browser through the command line. Try running this code in the Browser Console's command line (remember that to send multiple lines to the Browser Console, use Shift+Enter). Var newTabBrowser = gBrowser. GetBrowserForTab (gBrowser. SelectedTab); newTabBrowser. Get Firefox, a free web browser backed by Mozilla, a non-profit dedicated to internet health and privacy. Available now on Windows, Mac, Linux, Android and iOS. See how to download firefox for Windows 10. Mozilla Firefox internet browser is completely free and securely protects your privacy. Download firefox — free. Mozilla Firefox is a feature-rich and highly customizable web browser that’s user-friendly enough for beginners and sophisticated enough for advanced users. Firefox has managed to retain significant market share despite stiff competition from Google Chrome and Microsoft Internet Explorer and Edge.

The Browser Console is like the Web Console, but applied to the whole browser rather than a single content tab.

So it logs the same sorts of information as the Web Console - network requests, JavaScript, CSS, and security errors and warnings, and messages explicitly logged by JavaScript code. However, rather than logging this information for a single content tab, it logs information for all content tabs, for add-ons, and for the browser's own code.

If you also want to use the other web developer tools in the regular Web Toolbox with add-on or browser code, consider using the Browser Toolbox.

Similarly, you can execute JavaScript expressions using the Browser Console. But while the Web Console executes code in the page window scope, the Browser Console executes them in the scope of the browser's chrome window. This means you can interact with all the browser's tabs using the gBrowser global, and even with the XUL used to specify the browser's user interface.

NB: The Browser Console command line (to execute JavaScript expressions) is disabled by default. To enable it set the devtools.chrome.enabled preference to true in about:config, or set the 'Enable browser chrome and add-on debugging toolboxes' (Firefox 40 and later) option in the developer tool settings.

Opening the Browser Console

You can open the Browser Console in one of two ways:

  1. from the menu: select 'Browser Console' from the Web Developer submenu in the Firefox Menu (or Tools menu if you display the menu bar or are on macOS).
  2. from the keyboard: press Ctrl+Shift+J (or Cmd+Shift+J on a Mac).

You can also start the Browser Console by launching Firefox from the command line and passing the -jsconsole argument:

The Browser Console looks like this:

You can see that the Browser Console looks and behaves very much like the Web Console:

  • most of the window is occupied by a pane that display messages.
  • at the top, a toolbar enables you to filter the messages that appear.
  • at the bottom, a command line interpreter enables you to evaluate JavaScript expressions.

Beginning with Firefox 68, the Browser Console allows you to show or hide messages from the content process (i.e. the messages from scripts in all the opened pages) by setting or clearing the checkbox labeled Show Content Messages. The following image shows the browser console focused on the same page as above after clicking on the Show Content Messages checkbox.

Browser Console logging

The Browser console logs the same sorts of messages as the Web Console:

  • Warnings and errors (including JavaScript, CSS, security warnings and errors, and messages explicitly logged by JavaScript code using the console API)
  • Input/output messages: commands send to the browser via the command line, and the result of executing them

However, it displays such messages from:

  • web content hosted by all browser tabs
  • the browser's own code
  • add-ons

Messages from add-ons

The Browser Console displays messages logged by all Firefox add-ons.

Console.jsm

Firefox

To use the console API from a traditional or bootstrapped add-on, get it from the Console module.

One exported symbol from Console.jsm is console. Below is an example of how to access it, which adds a message to the Browser Console.

Learn more:

HUDService

There is also the HUDService which allows access to the Browse Console. The module is available at Mozilla DXR. We see we can not only access the Browser Console but also Web Console.

Here is an example on how to clear the contents of the Browser console:

If you would like to access the content document of the Browser Console this can be done with the HUDService. This example here makes it so that when you mouse over the 'Clear' button it will clear the Browser Console:

Bonus Features Available

For Add-on SDK add-ons, the console API is available automatically. Here's an example add-on that just logs an error when the user clicks a widget:

If you build this as an XPI file, then open the Browser Console, then open the XPI file in Firefox and install it, you'll see a widget labeled 'Error!' in the Add-on bar:

Click the icon. You'll see output like this in the Browser Console:

For Add-on SDK-based add-ons only, the message is prefixed with the name of the add-on ('log-error'), making it easy to find all messages from this add-on using the 'Filter output' search box. By default, only error messages are logged to the console, although you can change this in the browser's preferences.

Browser Console command line

The Browser Console command line is disabled by default. To enable it set the devtools.chrome.enabled preference to true in about:config, or set the 'Enable chrome debugging' option in the developer tool settings.

Like the Web Console, the command line interpreter enables you to evaluate JavaScript expressions in real time:Also like the Web Console's command line interpreter, this command line supports autocomplete, history, and various keyboard shortcuts and helper commands. If the result of a command is an object, you can click on the object to see its details.

But while the Web Console executes code in the scope of the content window it's attached to, the browser console executes code in the scope of the chrome window of the browser. You can confirm this by evaluating window:

This means you can control the browser: opening, closing tabs and windows and changing the content that they host, and modify the browser's UI by creating, changing and removing XUL elements.

Controlling the browser

The command line interpreter gets access to the tabbrowser object, through the gBrowser global, and that enables you to control the browser through the command line. Try running this code in the Browser Console's command line (remember that to send multiple lines to the Browser Console, use Shift+Enter):

It adds a listener to the currently selected tab's load event that will eat the new page, then loads a new page.

Firefox Movie

Note: You can restart the browser with the command Ctrl + Alt + R (Windows, Linux) or Cmd + Alt + R (Mac) This command restarts the browser with the same tabs open as before the restart.

Modifying the browser UI

Since the global window object is the browser's chrome window, you can also modify the browser's user interface. On Windows, the following code will add a new item to the browser's main menu:

On macOS, this similar code will add a new item to the Tools menu:

Windows 10 may show you a warning when installing apps that aren't from the Microsoft store. See Windows 10 warns me to use a 'Microsoft-verified' app for more information.

This article explains how to download and install Firefox on Windows using a simplified online installer. (If you need a full, offline installer or custom options, see For advanced users, below.)

  • To update Firefox from a previous version, see Update Firefox to the latest release.

Firefox Windows Xp

This article only applies to Windows.For instructions to install Firefox on Mac, see How to download and install Firefox on Mac.For instructions to install Firefox on Linux, see Install Firefox on Linux.

Firefox Menu Bar

Before installing Firefox, see the Firefox System Requirements to make sure that your computer has the required operating system and recommended hardware.

Do not install Firefox using a limited Windows XP account. For more information, see Microsoft's support article How to determine your user account type in Windows.

  1. Visit this Firefox download page in any browser, such as Microsoft Internet Explorer or Microsoft Edge.
  2. Click the button. The Firefox Installer that downloads will automatically offer you the best available version of Firefox for your computer.
    • If you use Microsoft Edge or Internet Explorer, a notification bar will appear at the bottom of the page with an option to open or run the Firefox Installer file.
    • Click Open file on Microsoft Edge or on Internet Explorer, to start the process.
    • In other browsers, you may need to first save the Firefox installer to your computer, then open the file you downloaded.
      Note: If you see an Open File - Security Warning dialog, click or .

  3. The User Account Control dialog may open, to ask you to allow the Firefox Installer to make changes to your computer. If this dialog appears, click to start the installation.
  4. Wait for Firefox to finish installing.
  5. When the installation is complete, Firefox will open.
Note: A notification bar with a button may be shown at the bottom of the page, if Firefox was previously installed. See Refresh Firefox - reset add-ons and settings to learn more.
Congratulations, you are done installing Firefox!

Double-click the Firefox icon that was placed on the desktop whenever you want to go online.

Having problems?

Here are some articles that can help you:

If you need more help, you can always get community support.

The streamlined Firefox Installer installs a suitable Firefox version for your language and operating system. For example, on 64-bit Windows, it installs the 64-bit version of Firefox (details here). To install Firefox in another language or operating system, or if you need a full, offline installer with custom options, download the Firefox Setup file from this download page. Options available in the full, offline installer are described in the article, Custom installation of Firefox on Windows.