-
Notifications
You must be signed in to change notification settings - Fork 22.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
externally_connectable doc improvements #20438
externally_connectable doc improvements #20438
Conversation
Preview URLs
External URLs (1)URL:
(this comment was updated 2022-09-25 22:04:34.565202) |
@@ -24,6 +24,8 @@ You can call this: | |||
|
|||
Note that you can't use this function to connect an extension to its content scripts. To do this, use {{WebExtAPIRef('tabs.connect()')}}. | |||
|
|||
By default, this connection can exchange messages with any other extension. However, the [`externally_connectable`](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/externally_connectable) manifest key can be used to limit communication to specific extensions and enable communication with websites. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By default, this connection can exchange messages with any other extension. However, the [`externally_connectable`](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/externally_connectable) manifest key can be used to limit communication to specific extensions and enable communication with websites. | |
By default, this connection can exchange messages with any other extension instead of itself via the `extensionId` parameter. However, the [`externally_connectable`](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/externally_connectable) manifest key can be used to limit communication to specific extensions and enable communication with websites. |
Clarification; please apply something along the lines of this to all similar texts in the PR.
@@ -15,14 +15,16 @@ browser-compat: webextensions.api.runtime.onMessageExternal | |||
--- | |||
{{AddonSidebar()}} | |||
|
|||
Use this event to listen for messages from another extension. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep this; "from another extension or web page".
Explicitly not the extension itself.
|
||
> **Note:** | ||
> For communication with web pages: | ||
> - In Chrome, `chrome.runtime.connect` and `chrome.runtime.sendMessage` are used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add sentence:
These methods are only available if there is at least one extension that listens for messages (https://groups.google.com/a/chromium.org/g/chromium-extensions/c/tCWVZRq77cg/m/KB6-tvCdAgAJ).
(Maybe something link text instead of just a plain link?)
files/en-us/mozilla/add-ons/webextensions/api/runtime/connect/index.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Rob Wu <[email protected]>
* externally_connectable doc improvements * Updates from feedback * lint issues fix * Review feedback Co-authored-by: Rob Wu <[email protected]> Co-authored-by: Rob Wu <[email protected]>
Description
This change removes the experimental flag from the
externally_connectable
manifest key and adds clarification about the APIs that can be used to send messages from webpages to extensions. Also, references to the function ofexternally_connectable
are added toruntime.sendMessage()
,runtime.onMessageExternal
, andruntime.connect()
.Motivation
Complete work started in #19838