runtime.getVersion()

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

Syntax

js
let extensionVersion = await 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:

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

Browser compatibility

See also