Search code examples
google-chrome-extensionmessage-passinggoogle-chrome-app

Message Passing from Packaged App to Extension


I have seen this article about passing messages between extensions which works when you know the extension ids.

But, what I would really like to do is pass a message from a packaged app to an extension. I tried to implement the steps in the article above. But i received the message that chrome.extension is not defined.

I assumed this is because it is a packaged app, that it doesnt have chrome.extension.

Is there a way to do this?

Thanks AH


Solution

  • Cross-extension messaging

    In addition to sending messages between different components in your extension, you can use the messaging API to communicate with other extensions. This lets you expose a public API that other extensions can take advantage of.

    Listening for incoming requests and connections is similar to the internal case, except you use the runtime.onMessageExternal or runtime.onConnectExternal methods.

    http://developer.chrome.com/dev/extensions/messaging.html