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
| desktop | mobile | ||||||
|---|---|---|---|---|---|---|---|
getVersion
|
|
|
|
|
|
|
|
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- See implementation notes.
See also
- The
runtime.getManifest()method, which returns the entire manifest as an object. - Manifest
versionkey