chrome.runtime.onMessage.addListener( function(request, sender, sendResponse) { console.log(sender.tab ? "from a content script:" + sender.tab.url : "from the extension"); if (request.greeting == "raise") // send message to native messaging host //actually its a fake message, it only opens the ZoomRaiseHand Script chrome.runtime.sendNativeMessage('de.joelbaldauf.jwconfzoomhand', { text: 'raisehand' }); });