Skip to main content
Chrome and Firefox disagree about what a theme color looks like. Firefox parses theme.colors values as CSS strings, while Chrome only accepts integer arrays. Extension.js resolves the difference at build time, so one manifest.json serves both engines.

One manifest, two color formats

Write hex colors in your manifest and build for any target:
For Chromium-family targets, the build writes each color string as the integer array that Chrome requires. One note lists the keys that it wrote. For Gecko targets, the string form ships unchanged, because Firefox parses it natively. From 4.2.0, the build translates only a string with one exact [R, G, B] reading. That is 3 or 6 digit hex, rgb() with three whole numbers, or a CSS color name in any case. tomato becomes [255, 99, 71]. To state the Chromium colors in the source, write the arrays in manifest.json. Firefox reads the same arrays.

Invalid values fail the build

Chrome refuses the whole extension when a theme value has the wrong shape, so Extension.js catches the mistake at compile time instead. On Chromium-family targets, every invalid theme value becomes a compilation error naming the exact field:
  • theme.colors.* entries must be [R, G, B] or [R, G, B, A] arrays, or strings that the build translates.
  • A channel is a whole number from 0 to 255, and the alpha is a number from 0 to 1.
  • theme.tints.* entries must be [hue, saturation, lightness] arrays of exactly 3 numbers.
Each error explains what Chrome accepts for that specific field, so you fix the value instead of decoding a refusal screen in the browser. From 4.2.0, a color string with no exact reading stops the build with E_THEME_INVALID. That covers transparent, currentcolor, hex or rgba() with an alpha, percentages, and hsl(). The message names each field and the array to write in its place:

Safari targets warn

Safari has no theme surface. When you build for safari or a webkit-based target and the manifest carries any theme key, the build emits a warning. The field ships unchanged in the output manifest and Safari ignores it.

Static themes skip dev instrumentation

A static theme is a manifest with a theme key and no runtime surface. Extension.js treats a manifest as a static theme when none of these 15 keys is present: background, content_scripts, action, browser_action, page_action, sidebar_action, side_panel, options_page, options_ui, devtools_page, chrome_url_overrides, sandbox, user_scripts, declarative_net_request, web_accessible_resources Static themes are exempt from all dev instrumentation. There is nothing to instrument: no background, no pages, no content scripts. More importantly, a theme is validated against the theme schema, which forbids extra top-level keys, and addons.mozilla.org hard-errors on each one. Injecting dev-only keys would make the artifact stop being a valid theme. The decision reads your manifest.json from disk, not the in-flight build output. By the time dev patches land, the compiled manifest already carries injected keys and no longer looks like a theme.

Next steps