Communicating between a Chrome packaged app and a Chrome extension?

怎甘沉沦 提交于 2019-11-27 01:25:26

Yes, that is possible. The code sample in the documentation you linked works for any combination of app and extension.

The extension documentation for chrome.runtime.sendMessage says:

Sends a single message to onMessage event listeners within the extension (or another extension/app).

Messaging works the same in both extensions and apps, and they seem to be fully compatible; simply use the ID for the destination extension or app. If you look at the docs for the app version of chrome.runtime.sendMessage, you'll see that it is identical to the extension version.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!