From f9eba56fa8576ddd9ee5f3e3383187d81cf870f1 Mon Sep 17 00:00:00 2001 From: Kiara Rose Date: Thu, 18 Sep 2025 08:30:40 -0700 Subject: [PATCH 1/2] Add specification for `externally_connectable`. --- specification/index.bs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/specification/index.bs b/specification/index.bs index 7e3cbfcd..17185b9d 100644 --- a/specification/index.bs +++ b/specification/index.bs @@ -8,6 +8,7 @@ URL: https://w3c.github.io/webextensions/specification/index.html Editor: Mukul Purohit, Microsoft Corporation https://www.microsoft.com, mpurohit@microsoft.com Editor: Tomislav Jovanovic, Mozilla https://www.mozilla.org/, tjovanovic@mozilla.com Editor: Oliver Dunk, Google https://www.google.com, oliverdunk@chromium.org +Editor: Kiara Rose, Apple https://www.apple.com, kiara_rose@apple.com Abstract: [Placeholder] Abstract. Markup Shorthands: markdown yes @@ -143,7 +144,19 @@ This key may be present. ### Key `externally_connectable` -This key may be present. +The `externally_connectable` key declares which extensions and web pages can establish connections to the extension using [=runtime.connect()=] and [=runtime.sendMessage()=]. If omitted, all extensions may connect, but no web pages can connect. + +This key may be present and may include the following optional keys: + +#### Key `ids` + +A [=list=] of [=extension IDs=] that specifies which extensions can communicate with the extension. To allow all extensions, include the pattern `*` in the list. If left empty or omitted, no extensions can connect. + +#### Key `matches` + +A [=list=] of [=match patterns=] that specifies which web pages can communicate with the extension. If left empty or omitted, no web pages can connect. + +Any [=match patterns=] that include wildcard domains, or wildcard subdomains of a top-level domain, must be ignored. ### Key `devtools_page` From 7b043e62ba7623f3a4d51449ceb45fa55b98705f Mon Sep 17 00:00:00 2001 From: Kiara Rose Date: Wed, 12 Nov 2025 18:25:40 +0900 Subject: [PATCH 2/2] Clarify the cases in which no external extensions can connect to the extension. Also highlight runtime.onConnectExternal and runtime.onMessageExternal --- specification/index.bs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/specification/index.bs b/specification/index.bs index 17185b9d..ed02dd61 100644 --- a/specification/index.bs +++ b/specification/index.bs @@ -146,11 +146,13 @@ This key may be present. The `externally_connectable` key declares which extensions and web pages can establish connections to the extension using [=runtime.connect()=] and [=runtime.sendMessage()=]. If omitted, all extensions may connect, but no web pages can connect. +A connection from an external web page or extension triggers the [=runtime.onConnectExternal=] event listener to fire. Similarly, a message sent by an external web page or extension triggers the [=runtime.onMessageExternal=] event listener to fire. + This key may be present and may include the following optional keys: #### Key `ids` -A [=list=] of [=extension IDs=] that specifies which extensions can communicate with the extension. To allow all extensions, include the pattern `*` in the list. If left empty or omitted, no extensions can connect. +A [=list=] of [=extension IDs=] that specifies which extensions can communicate with the extension. To allow all extensions to connect, include the wildcard pattern `*`. If left empty or omitted while the `externally_connectable` key is present, no extensions can connect. #### Key `matches`