chrome_url_overrides

Type Object
Mandatory No
Example
  "chrome_url_overrides" : {
    "newtab": "my-new-tab.html"
  }

Use the chrome_url_overrides key to provide a custom replacement for the documents loaded into various special pages usually provided by the browser itself.

Syntax

The chrome_url_overrides key is an object that may have the following property:

Name Type Description
newtab String
New in Firefox 54

Provide a replacement for the document that's shown in the "new tab" page. This is the page that's shown when the user has opened a new tab but has not loaded any document into it: for example, by using the [Ctrl/Command]+T keyboard shortcut.

The replacement is given as a URL to an HTML file. The file must be bundled with the add-on: you can't specify a remote URL here. You can specify it relative to the add-on's root folder, like: "path/to/newtab.html".

The document can load CSS and JavaScript, just like a normal web page. JavaScript running in the page gets access to the same privileged "browser.*" APIs as the add-on's background script.

It's very good practice to include a <title> for the page, or the tab's title will be the "moz-extension://..." URL.

A common use case is to let the user define a new tab page: to do this, provide a custom new tab page that navigates to the page the user defined.

If two or more add-ons both define custom new tab pages, then the first one that gets to run wins. Note that this is different from Chrome's behavior, in which the last one wins.

To override the browser's homepage, use "chrome_settings_overrides" instead.

Chrome incompatibilities

chrome_url_overrides

If two or more add-ons both define a custom new tab page, then in Firefox the first add-on to run wins. In Chrome, the last add-on wins.

Example

"chrome_url_overrides" : {
  "newtab": "my-new-tab.html"
}

Document Tags and Contributors

 Contributors to this page: wbamberg
 Last updated by: wbamberg,