Communicating between a Chrome packaged app and a Chrome extension?

后端 未结 1 1792
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-29 05:50

I need to combine functionality available only in a Chrome packaged app (access to syncFileSystem) and functionality available only in a Chrome extension (injecting a script

相关标签:
1条回答
  • 2020-11-29 06:18

    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.

    0 讨论(0)
提交回复
热议问题