Skip to content

Commit 673a473

Browse files
rebloordotproto
andauthored
Web extension browser_specific_settings and extension ID updates (mdn#40541)
* Web extension browser_specific_settings and extension ID updates * Apply suggestions from review Co-authored-by: Simeon Vincent <svincent@gmail.com> --------- Co-authored-by: Simeon Vincent <svincent@gmail.com>
1 parent 5287e96 commit 673a473

File tree

3 files changed

+12
-8
lines changed
  • files/en-us/mozilla/add-ons/webextensions

3 files changed

+12
-8
lines changed

files/en-us/mozilla/add-ons/webextensions/implement_a_settings_page/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Implementing a settings page is a three-step process:
2121

2222
First, we'll write an extension that adds a blue border to every page the user visits.
2323

24-
Create a new directory called `settings`, then create a file called `manifest.json` inside it with the following contents:
24+
Create a directory called `settings`, then a file called `manifest.json` inside it with this content:
2525

2626
```json
2727
{
@@ -40,7 +40,7 @@ Create a new directory called `settings`, then create a file called `manifest.js
4040

4141
This extension instructs the browser to load a content script called "borderify.js" into all web pages the user visits.
4242

43-
Next, create a file called `borderify.js` inside the `settings` directory, and give it these contents:
43+
Next, create a file called `borderify.js` inside the `settings` directory, and give it this content:
4444

4545
```js
4646
document.body.style.border = "10px solid blue";
@@ -77,7 +77,7 @@ First, update `manifest.json` so it has these contents:
7777

7878
"browser_specific_settings": {
7979
"gecko": {
80-
"id": "addon@example.com"
80+
"id": "@addon-example"
8181
}
8282
}
8383
}

files/en-us/mozilla/add-ons/webextensions/manifest.json/browser_specific_settings/index.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ sidebar: addonsidebar
3131
<pre class="brush: json">
3232
"browser_specific_settings": {
3333
"gecko": {
34-
"id": "addon@example.com",
34+
"id": "@addon-example",
3535
"strict_min_version": "58.0"
3636
}
3737
}
@@ -80,14 +80,14 @@ To support Firefox for Android without specifying a version range, the `gecko_an
8080
The extension ID must be one of the following:
8181

8282
- [GUID](https://en.wikipedia.org/wiki/Universally_unique_identifier)
83-
- A string formatted like an email address: `extensionname@example.org`
83+
- A string formatted like an email address: `extensionname@example.org` However, use of an `@string` format is recommended.
8484

8585
The latter format is easier to generate and manipulate. Be aware that using a real email address here may attract spam.
8686

8787
For example:
8888

8989
```json
90-
"id": "extensionname@example.org"
90+
"id": "@extension-name.developer-name"
9191
```
9292

9393
```json
@@ -103,14 +103,18 @@ Safari stores its browser-specific settings in the `safari` sub-key, which has t
103103
- `strict_max_version`
104104
- : Maximum version of Safari to support.
105105

106+
### Chrome properties
107+
108+
Chrome doesn't use this key and ignores it if present in an extension's `manifest.json` file.
109+
106110
## Examples
107111

108112
Example with all possible keys. Note that most extensions omit `strict_max_version` and `update_url`.
109113

110114
```json
111115
"browser_specific_settings": {
112116
"gecko": {
113-
"id": "addon@example.com",
117+
"id": "@addon-example",
114118
"strict_min_version": "42.0",
115119
"strict_max_version": "50.*",
116120
"update_url": "https://example.com/updates.json"

files/en-us/mozilla/add-ons/webextensions/manifest.json/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ For complete example extensions, see [Example extensions](/en-US/docs/Mozilla/Ad
8888
{
8989
"browser_specific_settings": {
9090
"gecko": {
91-
"id": "addon@example.com",
91+
"id": "@addon-example",
9292
"strict_min_version": "42.0"
9393
}
9494
},

0 commit comments

Comments
 (0)