Jump to content
mrgoul

Passing a Message from a Chrome extension to an Autoit Application

Recommended Posts

mrgoul

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?

Share this post


Link to post
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

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.