connectNative method
Connects to a native application in the host machine. This method requires
the "nativeMessaging" permission. See Native
Messaging for more information.
application The name of the registered application to connect to.
returns Port through which messages can be sent and received with the
application
Implementation
Port connectNative(Object application) {
return Port.fromJS($js.chrome.runtime.connectNative(switch (application) {
String() => application.toJS,
NativeMessageTarget() => application.toJS,
_ => throw UnsupportedError(
'Received type: ${application.runtimeType}. Supported types are: String, NativeMessageTarget')
}));
}