MDN self-hosted library · e01.org

runtime.getVersion()

Returns the extension's version from the version manifest key.

Open notebook · 1 cells webextension-api-function upstream source

Returns the extension's version from the version manifest key.

Syntax

let extensionVersion = browser.runtime.getVersion()

Parameters

None.

Return value

A string containing the extension's version as declared in the manifest.

[!NOTE] The returned version may differ from the string in the file because the browser can parse and serialize it.

Examples

Get the extension version string:

const version = browser.runtime.getVersion();
console.log(version);

Browser compatibility

See also

  • The runtime.getManifest() method, which returns the entire manifest as an object.
  • Manifest version key