externally_connectable
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
Type | Object |
---|---|
Mandatory | No |
Example | "externally_connectable": { // List of extension IDs that extension wishes to communicate with // If "browser_action" is specified but "browser_action.ids" is not, // no extensions can communicate with this extension. // To match all extension IDs use "*". "ids": [ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "cccccccccccccccccccccccccccccccc" ], // Regular expression patterns specifying web pages // If "matches" is not specified, no web pages can communicate with // this extension "matches": [ "https://example1.com/*", "*://*.example2.com/*" ] } |
Externally connectable allows extension developer to control which other extensions and web pages can communicate with this extension via runtime.connect()
and runtime.sendMessage()
message passing. If externally_connectable
is not specified, all extensions can communicate with each other but not with web pages.
"ids" attribute
ids
enables communication between this extension and other installed extensions specified by extension identifiers. Use the pattern "*"
if you wish to communicate with all extensions.
"matches" attribute
matches
enables communication between this extension and the web pages. This is a list of regular expressions for page URLs that you wish to communicate with.
Note: If browser_action
is not specified, communication among extensions is still allowed as if browser_action
was {"ids": ["*"] }
, therefore if you specify browser_action.matches
don't forget to add ids
if you still want to communicate with other extensions.
Browser compatibility
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
externally_connectable |
Yes |
79 |
No
See bug 1319168.
|
? |
Yes |
No |
? |
? |
No |
? |
? |
? |
© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/externally_connectable