Adrià Vilanova Martínez | 3465e77 | 2021-07-11 19:18:41 +0200 | [diff] [blame] | 1 | // This method is based on the fact that when building the extension for Firefox |
| 2 | // the browser_specific_settings.gecko entry is included. |
| 3 | export function isFirefox() { |
| 4 | var manifest = chrome.runtime.getManifest(); |
| 5 | return manifest.browser_specific_settings !== undefined && |
| 6 | manifest.browser_specific_settings.gecko !== undefined; |
| 7 | } |
| 8 | |
| 9 | // Returns whether the extension is a release version. |
| 10 | export function isReleaseVersion() { |
| 11 | var manifest = chrome.runtime.getManifest(); |
| 12 | return ('version' in manifest) && manifest.version != '0'; |
| 13 | } |
Adrià Vilanova Martínez | e32adc4 | 2021-08-30 17:16:49 +0200 | [diff] [blame] | 14 | |
| 15 | // Returns the extension version |
| 16 | export function getExtVersion() { |
| 17 | var manifest = chrome.runtime.getManifest(); |
| 18 | return manifest?.version; |
| 19 | } |