I am trying to incorporate native messaging with my chrome extension and my java application.
In my chrome extension's javascript, I have the following code. (I do have the nativeMessaging permission in my manifest.json)
function connectToNativeApp()
{
console.log('connecting to native app...');
port = chrome.runtime.connectNative('com.app.native');
port.onMessage.addListener(onNativeMessage);
port.onDisconnect.addListener(onDisconnected);
console.log('connected to native app...');
}
When I send a message to the native app, my java app is supposed to be send backa message to the extension, but it is not. To test if it is actually connecting to the extension, I typed the host name incorrectly in the connectNative method but no error!?
I heard something about needing to add a registry key, as I am on windows, but I do not know how to and there is no NativeMessagingHosts folder under the chrome folder in regedit.
My native app folder is also in the same folder as the chrome extension. I tried looking for many tutorials, but found none useful for my problem. Why does Windows make everything complicated? :)
Please help. Thanks for your time and help. Subby