According to Assessing Your Safari Web Extension’s Browser Compatibility and https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/onMessageExternal, runtime.onMessageExternal API should work in Safari 14. However, the reality is different.
Scenario:
- having two web extensions; say A (with runtime.id = '123'), and B (with runtime.id = 'xyz').
- go to the Web Inspector of B and run this:
chrome.runtime.onMessageExternal.addListener((message, sender, sendResponse) => {console.log(
${sender.id})})
This should make B wait for an external message.
- go to the Web Inspector of A and run this:
chrome.runtime.sendMessage('xyz', {message: 'whatever'})
Expect:
- '123' is printed on the Web Inspector of B
- This works perfectly fine on Chrome.
Actual:
- Nothing on the Web Inspector of B
- Got a Promise on the Web Inspector of A -- {result: undefined, status: "resolved"}
Please confirm this is a bug and please fix.