|
1 | 1 | ---
|
2 |
| -title: Manifest Version Format |
| 2 | +title: Legacy Version Formats |
3 | 3 | slug: Mozilla/Add-ons/WebExtensions/manifest.json/version/format
|
4 | 4 | tags:
|
5 | 5 | - Add-ons
|
|
9 | 9 |
|
10 | 10 | {{AddonSidebar}}
|
11 | 11 |
|
12 |
| -A **version string** consists of one or more _version parts_, separated with dots. |
| 12 | +This page describes legacy web extension version string formats. See the manifest [version key](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/version) documentation for information on the current version string format. |
13 | 13 |
|
14 |
| -Each **version part** is itself parsed as a sequence of four parts: `<number-a><string-b><number-c><string-d>`. Each of the parts is optional. Numbers are integers base 10 (may be negative), strings are non-numeric ASCII characters. |
| 14 | +## Firefox legacy version number |
15 | 15 |
|
16 |
| -A few examples of valid version parts: |
| 16 | +A **version string** consists of one or more _version parts_, separated by dots. |
| 17 | + |
| 18 | +Each **version part** is parsed as a sequence of four parts: `<number-a><string-b><number-c><string-d>`. Each of the parts is optional. Numbers are integers base 10 (may be negative), and strings are non-numeric ASCII characters. |
| 19 | + |
| 20 | +Here are a few examples of valid version parts: |
17 | 21 |
|
18 | 22 | - `0` (as in `1.0`): `<number-a>=0`
|
19 | 23 | - `5a` (as in `1.5a`): `<number-a>=5`, `<string-b>=a`
|
20 | 24 | - `5pre4` (as in `3.5pre4`): `<number-a>=5`, `<string-b>=pre`, `<number-c>=4`
|
21 | 25 | - `*` (as in `1.0.*`): `<string-b>=*`
|
22 | 26 |
|
23 |
| -A few special parsing rules are applied for backwards compatibility and readability: |
| 27 | +A few special parsing rules are applied for backward compatibility and readability: |
24 | 28 |
|
25 | 29 | - if the version part is a single asterisk, it is interpreted as an infinitely-large number:
|
26 | 30 | `1.5.0.*` is the same as `1.5.0.(infinity)`
|
27 | 31 | - if string-b is a plus sign, number-a is incremented to be compatible with the Firefox 1.0.x version format:
|
28 | 32 | `1.0+` is the same as `1.1pre`
|
29 | 33 |
|
30 |
| -The rationale behind splitting a version part into a sequence of strings and numbers is that when comparing version parts, the numeric parts are compared as numbers, e.g. '1.0pre1' < '1.0pre10', while the strings are compared bytewise. See the next section for details on how versions are compared. |
| 34 | +The rationale behind splitting a version part into a sequence of strings and numbers is that when comparing version parts, the numeric parts are compared as numbers, for example, '1.0pre1' < '1.0pre10', while the strings are compared byte-wise. See the next section for details on how versions are compared. |
31 | 35 |
|
32 |
| -See [maintenance policy](https://extensionworkshop.com/documentation/publish/signing-and-distribution-overview/#distributing-your-addon) for special rules that mark version as "beta" in the AMO queues. |
| 36 | +From Firefox 108, web extensions using this version string trigger a warning on installation. |
33 | 37 |
|
34 | 38 | ## Comparing versions
|
35 | 39 |
|
36 | 40 | When two version strings are compared, their version parts are compared left to right. An empty or missing version part is equivalent to `0`.
|
37 | 41 |
|
38 |
| -If at some point a version part of one version string is greater than the corresponding version part of another version string, then the first version string is greater than the other one. |
| 42 | +If at some point, a version part of one version string is greater than the corresponding version part of another version string, then the first version string is greater than the other one. |
39 | 43 |
|
40 |
| -Otherwise, the version strings are equal. Note that since missing version parts are treated as if they were `0`, the following version strings are equal: `1`, `1.0`, `1.0.`, `1.0.0`, and even `1.0..`. |
| 44 | +Otherwise, the version strings are equal. As missing version parts are treated as if they were `0`, these version strings are equal: `1`, `1.0`, `1.0.`, `1.0.0`, and even `1.0..`. |
41 | 45 |
|
42 | 46 | ### Comparing version parts
|
43 | 47 |
|
44 |
| -Version parts are also compared left to right, parts A and C are compared as numbers, while parts B and D are compared byte-wise. A string-part that exists is always less than a string-part that doesn't exist (`1.6a` is less than `1.6`). |
| 48 | +Version parts are also compared left to right; parts A and C are compared as numbers, while parts B and D are compared byte-wise. A string part that exists is always less than a string part that doesn't exist (`1.6a` is less than `1.6`). |
45 | 49 |
|
46 | 50 | ## Examples
|
47 | 51 |
|
|
0 commit comments