GoogleChrome / chrome-extensions-samples

Chrome Extensions Samples
https://developer.chrome.com/docs/extensions
Apache License 2.0
15.28k stars 8.16k forks source link

Add natively_connectable example #667

Open guest271314 opened 2 years ago

guest271314 commented 2 years ago

Describe the bug No natively_connectable example exists in this repository.

To Reproduce Search for "natively_connectable" in this repository.

Expected behavior A clear and concise description of "natively_connectable" usage and sample.

Screenshots Screenshot_2022-01-30_09-36-13

Notes

https://peter.sh/experiments/chromium-command-line-switches/

--native-messaging-connect-extension ⊗ | Requests a native messaging connection be established between the extension with ID specified by this switch and the native messaging host named by the kNativeMessagingConnectHost switch. ↪

--native-messaging-connect-host ⊗ | Requests a native messaging connection be established between the native messaging host named by this switch and the extension with ID specified by kNativeMessagingConnectExtension. ↪

--native-messaging-connect-id ⊗ | If set when kNativeMessagingConnectHost and kNativeMessagingConnectExtension are specified, is reflected to the native messaging host as a command line parameter. ↪

Source: https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/extensions/api/messaging/native_messaging_launch_from_native.cc

Ambushfall commented 2 years ago

Mind if I ask is this in relation to the docs for inter-extension comms?

guest271314 commented 2 years ago

@Ambushfall See https://source.chromium.org/chromium/chromium/src/+/2b8421795551f52c47012d95f482be6c03e1fc16

Allow natively-initiated native messaging connections.

Support native apps using the command lines passed in --reconnect-command to request the native messaging connection be re-established by implementing the --native-messaging-connect-host and --native-messaging-connect-extension switches. Only allow this when Chrome is already running for now since transientBackground mode is not yet supported.

Bug: 967262