Open Bug 1757293 Opened 3 years ago Updated 2 years ago

Extension fails to load if an unrecognized property is set in browser_specific_settings.gecko

Categories

(WebExtensions :: General, task, P2)

task

Tracking

(Not tracked)

People

(Reporter: robwu, Assigned: robwu)

References

Details

(Whiteboard: [addons-jira])

The manifest schema of the browser_specific_settings.gecko object is at https://searchfox.org/mozilla-central/rev/99a293b5c42bf62da2c7a0a65c7210d10f392a9f/toolkit/components/extensions/schemas/manifest.json#567-592

It specifies a set of properies, but without "additionalProperties": { "$ref": "UnrecognizedProperty" }.

Consequently, if we ever add a new property, and extensions want to use it, then extension authors will be forced to drop compatibility for older versions, because we currently fail hard when a property is set.

To allow us to add new properties in the future, we should add "additionalProperties": { "$ref": "UnrecognizedProperty" }.

STR:

  1. Create manifest.json containing:
{
  "name": "test",
  "version": "1",
  "manifest_version": 2,
  "browser_specific_settings": {
    "gecko": {
      "some_new_prop": "some value"
    }
  }
}
  1. Visit about:debugging and try to load the directory containing the above manifest.json

Expected:

  • Extension loads, browser console may contain a warning.

Actual:

  • Extension fails to load, browser console contains error:

1645913168328 addons.webextension.<unknown> ERROR Loading extension 'null': Reading manifest: Error processing browser_specific_settings.gecko: Unexpected property "some_new_prop"

Error: Extension is invalid

We might have a bug for this somewhere. This is why distribution control put the key in the top level rather than in bss.

We should try to do this before next ESR. Thee issue with making it more relaxed, we risk typos making the extension behave unexpectedly.

To counter that, we could make thee id property required if the gecko key is present. Luca suggested we might be more strict in the linter, but keep it more relaxed in Firefox.

Assignee: nobody → rob
Severity: -- → N/A
Priority: -- → P2
Whiteboard: [addons-jira]
You need to log in before you can comment on or make changes to this bug.