Jump to content

Passing a Message from a Chrome extension to an Autoit Application


mrgoul
 Share

Recommended Posts

I have Autoit Chrome extension that interacts with the Autoit application though nativeMessaging. 
I am using the following code to get a message from Autoit to the extension:

var port = chrome.runtime.connectNative('com.my_company.my_application');
port.onMessage.addListener(function(msg) {
  console.log("Received" + msg);
}); 

And I then use this code to try and send a message from the extension to Autoit:

  var port = chrome.runtime.connect({name: "knockknock"});
    port.postMessage({joke: "Knock knock"});

     //or
    chrome.runtime.sendNativeMessage('com.my_company.my_application',
  { text: "Hello" },
  function(response) {
    console.log("Received " + response);
  });

But how can I then make the Autoit application evaluate the messages sent from the extension?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...