My extension (https://chrome.google.com/webstore/detail/sauce-for-strava/eigiefcapdcdmncdghkeahgfmnobigha) uses a channel/ports to communicate between page scripts and the ext content script. To do this it uses the transfer argument of postMessage
but when I use the transfer argument to postMessage the event handler gets an event with a null data
property.
Steps to reproduce:
- Call
postMessage({foo: 'bar', port}, self.origin, [port])
from page script. - Add window.message event handler to an extension content script and evaluate the event callback arg.
- Observe the ev.data is null instead of
{foo: 'bar', port: port}
Incidentally I can see that a kagi based event listener is also getting this message and it also produces a console error because it assumes ev.data is an object.
Expected behavior:
For the message handler to get an event object with a non-null data
property filed with the contents sent from the postMessage caller.
Orion, OS version; hardware type:
0.99.123.3-beta, macOS 13.2.1, MBP 2021 (arm64)