Skip to content

Proposal: runtime.getVersion() method #878

@oliverdunk

Description

@oliverdunk

We should add a new method to get the installed version of an extension:

getVersion(): string

Today, there is significant usage of runtime.getManifest().version as an analogue to this.

By adding a new method:

  • In the short term, this simplifies getting this data, and makes it easier to see usage in static analysis.
  • Longer term, this may reduce usage of getManifest() and allow us to deprecate it or limit availability to certain contexts. This is desirable as the behavior is poorly defined - see Inconsistency: runtime.getManifest() and missing keys #400.

Availability:

Trusted extension contexts and content scripts.

This matches getManifest() since there is significant usage in both contexts.

This API is still synchronous to encourage adoption as an alternative to the synchronous getManifest().

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions