icons

Type Object
Mandatory No
Manifest version 2 or higher

The icons key specifies icons for your extension. Those icons represent the extension in components such as the add-ons manager (about:addons).

The key consists of key-value pairs specifying the image size in pixels and the image path relative to the extension's root directory.

If icons is not supplied, a standard extension icon is used.

You should supply an extension icon, ideally 32x32 px in size. This is the default icon that is used in the add-ons manager. You can supply icons of any size, and Firefox uses the one that fits a component best.

Firefox considers the screen resolution when choosing an icon. To deliver the best visual experience to users with high-resolution displays, such as Retina displays, provide double-sized versions of your icons.

Example

The keys in the icons object specify the icon size in pixels, and values specify the relative icon file path. This example contains a 32px extension icon and a larger version for high-resolution displays.

json
"icons": {
  "32": "icon.png",
  "64": "icon@2x.png"
}

SVG

You can use SVG, and the browser scales your icon appropriately. There are two caveats:

  1. You need to specify a viewBox in the image, e.g.:

    html
    <svg
      xmlns="http://www.w3.org/2000/svg"
      viewBox="0 0 32 32"
      width="32"
      height="32">
      <!-- your svg content -->
    </svg>
    
  2. Even though you can use one SVG file, you need to specify icon sizes in your manifest, e.g.:

    json
    "icons": {
      "32": "icon.svg",
      "64": "icon.svg"
    }
    

You can use a media query on prefers-color-scheme to update the icon for light and dark themes. For example:

css
#outside {
  fill: black;
}
#inside {
  fill: red;
}
@media (prefers-color-scheme: dark) {
  #outside {
    fill: white;
  }
  #inside {
    fill: black;
  }
}

For more information, see the themed-icons example.

Note: Chromium-based browsers don't support this feature. See Chromium bug 29683.

Note: Remember to include the xmlns attribute when creating the SVG. Otherwise, Firefox won't display the icon.

Note: When using a program such as Inkscape to create SVG, save your file as a "plain SVG". Firefox isn't guaranteed to handle special namespaces and may not display an icon containing them.

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Firefox for Android
Safari on iOS
icons
Chrome – Full support
Chrome 54 (Release date: 2016-10-12)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – Full support
Firefox 48 (Release date: 2016-08-02)
footnote Full support
Opera – Full support
Opera 41 (Release date: 2016-10-25)
footnote Full support
Safari – Full support
Safari 14 (Release date: 2020-09-16)
footnote Full support
Firefox for Android – Full support
Firefox for Android 48 (Release date: 2016-08-02)
footnote Full support
Safari on iOS – Full support
Safari on iOS 15 (Release date: 2021-09-20)
footnote Full support
SVG icons
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 92 (Release date: 2021-09-07)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – Full support
Safari 16.4 (Release date: 2023-03-27)
footnote Full support
Firefox for Android – Full support
Firefox for Android 92 (Release date: 2021-09-07)
footnote Full support
Safari on iOS – Full support
Safari on iOS 16.4 (Release date: 2023-03-27)
footnote Full support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support