From 9e318a36e136060440b6a94797dcddd345fd472c Mon Sep 17 00:00:00 2001 From: amysteamdev <37001393+AmySteam@users.noreply.github.com> Date: Fri, 4 Nov 2022 10:24:18 -0500 Subject: [PATCH 01/17] Rewrite intro --- site/en/docs/extensions/mv3/manifest/index.md | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/site/en/docs/extensions/mv3/manifest/index.md b/site/en/docs/extensions/mv3/manifest/index.md index c88a5dc71086..1b8ef59db80c 100644 --- a/site/en/docs/extensions/mv3/manifest/index.md +++ b/site/en/docs/extensions/mv3/manifest/index.md @@ -1,20 +1,18 @@ --- -layout: "layouts/doc-post.njk" -title: "Manifest file format" +layout: 'layouts/doc-post.njk' +title: 'Manifest file format' date: 2012-09-18 -updated: 2021-10-08 -description: An overview of the manifest.json properties that you can use in your Chrome Extension. +updated: 2022-11-08 +description: An overview of the manifest.json properties of a Chrome Extension. --- -{# TODO: need to create any required child pages for new mv3 properties, e.g. host_permissions, and link them here. #} - -Every extension has a [JSON][1]\-formatted manifest file, named `manifest.json`, that provides -important information. +Every extension requires a [JSON][1]\-formatted file, named `manifest.json`, that provides +important information. This file must be located in the extension's root directory. ## Field summary {: #overview } -The following code shows the supported manifest fields for Extensions, with links to the page that -discusses each field. +The following code shows the supported manifest keys, with links to pages that +describe each property.
{
// Required
From 9c3fb349173fa97f7c0cdc2e46cd07f82916b5e8 Mon Sep 17 00:00:00 2001
From: amysteamdev <37001393+AmySteam@users.noreply.github.com>
Date: Fri, 4 Nov 2022 10:28:38 -0500
Subject: [PATCH 02/17] Remove keys for internal use only
---
site/en/docs/extensions/mv3/manifest/index.md | 5 -----
1 file changed, 5 deletions(-)
diff --git a/site/en/docs/extensions/mv3/manifest/index.md b/site/en/docs/extensions/mv3/manifest/index.md
index 1b8ef59db80c..babd3abe7f0e 100644
--- a/site/en/docs/extensions/mv3/manifest/index.md
+++ b/site/en/docs/extensions/mv3/manifest/index.md
@@ -41,13 +41,10 @@ describe each property.
"content_capabilities": ...,
"content_scripts": [{...}],
"content_security_policy": {...},
- "converted_from_user_script": ...,
"cross_origin_embedder_policy": {"value": "require-corp"},
"cross_origin_opener_policy": {"value": "same-origin"},
- "current_locale": ...,
"declarative_net_request": ...,
"devtools_page": "devtools.html",
- "differential_fingerprint": ...,
"event_rules": [{...}],
"externally_connectable": {
"matches": ["*://*.example.com/*"]
@@ -79,7 +76,6 @@ describe each property.
"page": "options.html"
},
"permissions": ["tabs"],
- "platforms": ...,
"replacement_web_app": ...,
"requirements": {...},
"sandbox": [...],
@@ -87,7 +83,6 @@ describe each property.
"storage": {
"managed_schema": "schema.json"
},
- "system_indicator": ...,
"tts_engine": {...},
"update_url": "https://path/to/updateInfo.xml",
"version_name": "aString",
From 68eafe544f6bf852b120f204e8657bd6d750b409 Mon Sep 17 00:00:00 2001
From: amysteamdev <37001393+AmySteam@users.noreply.github.com>
Date: Fri, 4 Nov 2022 10:39:24 -0500
Subject: [PATCH 03/17] Add mdn json link
---
site/en/docs/extensions/mv3/manifest/index.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/site/en/docs/extensions/mv3/manifest/index.md b/site/en/docs/extensions/mv3/manifest/index.md
index babd3abe7f0e..3ede26ca9c56 100644
--- a/site/en/docs/extensions/mv3/manifest/index.md
+++ b/site/en/docs/extensions/mv3/manifest/index.md
@@ -6,7 +6,7 @@ updated: 2022-11-08
description: An overview of the manifest.json properties of a Chrome Extension.
---
-Every extension requires a [JSON][1]\-formatted file, named `manifest.json`, that provides
+Every extension requires a [JSON][mdn-json]\-formatted file, named `manifest.json`, that provides
important information. This file must be located in the extension's root directory.
## Field summary {: #overview }
@@ -89,4 +89,4 @@ describe each property.
"web_accessible_resources": [...]
}
-[1]: https://www.json.org
+[mdn-json]: https://developer.mozilla.org/docs/Glossary/JSON
From f9d2e553637f01cf203bb0e1145b86d99cf5f0bd Mon Sep 17 00:00:00 2001
From: amysteamdev <37001393+AmySteam@users.noreply.github.com>
Date: Tue, 8 Nov 2022 13:12:32 -0600
Subject: [PATCH 04/17] Add code samples Minor tweaks
---
.../mv3/manifest/default_locale/index.md | 13 ++-
.../mv3/manifest/description/index.md | 16 +++-
.../manifest/externally_connectable/index.md | 80 ++++++----------
.../extensions/mv3/manifest/icons/index.md | 3 +-
.../mv3/manifest/manifest_version/index.md | 8 +-
.../extensions/mv3/manifest/name/index.md | 24 +++--
.../extensions/mv3/manifest/version/index.md | 20 ++--
.../extensions/mv3/shared_modules/index.md | 95 +++++++++++++++++++
8 files changed, 173 insertions(+), 86 deletions(-)
create mode 100644 site/en/docs/extensions/mv3/shared_modules/index.md
diff --git a/site/en/docs/extensions/mv3/manifest/default_locale/index.md b/site/en/docs/extensions/mv3/manifest/default_locale/index.md
index 384bdf7e44f5..39fb146bb24d 100644
--- a/site/en/docs/extensions/mv3/manifest/default_locale/index.md
+++ b/site/en/docs/extensions/mv3/manifest/default_locale/index.md
@@ -6,8 +6,13 @@ updated: 2018-04-26
description: Reference documentation for the default_locale property of manifest.json.
---
-Specifies the subdirectory of `_locales` that contains the default strings for this extension. This
-field is **required** in extensions that have a `_locales` directory; it **must be absent** in
-extensions that have no `_locales` directory. For details, see [Internationalization][1].
+Defines the default language of an extension that supports multiple locales. It is the name of the subdirectory in `_locales` that contains the default language for this extension. For example, the following code indicates that English is the default language:
-[1]: /docs/extensions/i18n
+```json
+"default_locale": "en"
+```
+
+This field is **required** for localized extensions (those with a `_locales` directory), but **must be absent** in
+extensions that have no `_locales` directory. For details, see [Internationalization][api-i18n].
+
+[api-i18n]: /docs/extensions/i18n
diff --git a/site/en/docs/extensions/mv3/manifest/description/index.md b/site/en/docs/extensions/mv3/manifest/description/index.md
index 4150449108b1..f493829414f7 100644
--- a/site/en/docs/extensions/mv3/manifest/description/index.md
+++ b/site/en/docs/extensions/mv3/manifest/description/index.md
@@ -7,9 +7,15 @@ description: Reference documentation for the description property of manifest.js
---
A plain text string (no HTML or other formatting; no more than 132 characters) that describes the
-extension. The description should be suitable for both the browser's extension management UI and the
-[Chrome Web Store][1]. You can specify locale-specific strings for this field; see
-[Internationalization][2] for details.
+extension. For example:
-[1]: https://chrome.google.com/webstore
-[2]: /docs/extensions/i18n
+```json
+"description": "A description of my extension"
+```
+
+The description should be suitable for both the browser's Extensions page (chrome://extensions) and the
+[Chrome Web Store][cws]. You can specify locale-specific strings for this field; see
+[Internationalization][api-i18n] for details.
+
+[cws]: https://chrome.google.com/webstore
+[api-i18n]: /docs/extensions/i18n
diff --git a/site/en/docs/extensions/mv3/manifest/externally_connectable/index.md b/site/en/docs/extensions/mv3/manifest/externally_connectable/index.md
index c7c059efedeb..4a82166ec03b 100644
--- a/site/en/docs/extensions/mv3/manifest/externally_connectable/index.md
+++ b/site/en/docs/extensions/mv3/manifest/externally_connectable/index.md
@@ -1,22 +1,21 @@
---
-layout: "layouts/doc-post.njk"
-title: "externally_connectable"
+layout: 'layouts/doc-post.njk'
+title: 'externally_connectable'
date: 2013-08-21
updated: 2014-10-31
description: Reference documentation for the externally_connectable property of manifest.json.
---
-The `externally_connectable` manifest property declares which extensions, apps, and web pages can
-connect to your extension via [runtime.connect][1] and [runtime.sendMessage][2].
+The `externally_connectable` manifest property declares which extensions and web pages can
+connect to your extension via [runtime.connect][runtime-connect] and [runtime.sendMessage][runtime-sendmessage].
-For a tutorial on message passing see [cross-extension and app messaging][3] and [sending messages
-from web pages][4].
+For a tutorial on message passing see [cross-extension messaging][messages-other-exts] and [sending messages
+from web pages][messages-webpage].
## Connecting without externally_connectable {: #without-externally-connectable }
-If `externally_connectable` is not declared in your extension's manifest, all extensions and apps
-can connect, but no webpages can connect. As a consequence, when updating your manifest to use
-`externally_connectable`, if `"ids": ["*"]` is not specified then other extensions and apps will
+If the `externally_connectable` key is **_not_** declared in your extension's manifest, all extensions can connect, but no webpages can connect. As a consequence, when updating your manifest to use
+`externally_connectable`, if `"ids": ["*"]` is not specified then other extensions will
lose the ability to connect to your extension. This may be an unintended consequence, so keep it in
mind.
@@ -26,28 +25,17 @@ mind.
{
"name": "My externally connectable extension",
"externally_connectable": {
- // Extension and app IDs. If this field is not specified, no
- // extensions or apps can connect.
"ids": [
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
...
- // Alternatively, to match all extensions and apps, specify only
- // "*".
- "*"
],
- // Match patterns for web pages. Does not affect content scripts.
// If this field is not specified, no webpages can connect.
"matches": [
"https://*.google.com/*",
"*://*.chromium.org/*",
...
],
- // Indicates that the extension would like to make use of the TLS
- // channel ID of the web page connecting to it. The web page must
- // also opt to send the TLS channel ID to the extension via setting
- // includeTlsChannelId to true in runtime.connect's connectInfo
- // or runtime.sendMessage's options.
"accepts_tls_channel_id": false
},
...
@@ -56,38 +44,32 @@ mind.
## Reference {: #reference }
-The externally_connectable manifest key can have the following properties:
+The `"externally_connectable"` manifest key includes the following _optional_ properties:
-- **`ids` (array of string)** - optional
+`"ids"`
+: The IDs of extensions that are allowed to connect. If left empty or unspecified, no extensions or apps can connect. The wildcard `"*"` will allow all extensions and apps to connect.
- The IDs of extensions or apps that are allowed to connect. If left empty or unspecified, no
- extensions or apps can connect.
+`"matches"`
+: The URL patterns for _web pages_ that are allowed to connect. If left empty or unspecified, no web pages can connect. Patterns cannot include wildcard domains nor subdomains of [(effective) top level domains][public-suffix], for example:
- The wildcard `"*"` will allow all extensions and apps to connect.
+| ✅ Valid URLs | ❌ Invalid URLs |
+|---------------------------|-----------------------|
+| `*://example.com/` | `*://example.com/one/` |
+| `http://*.example.org/*` | `