[Webkit-unassigned] [Bug 254777] New: REGRESSION: PostMessage with transfer object is broken between contexts
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Mar 30 15:09:03 PDT 2023
https://bugs.webkit.org/show_bug.cgi?id=254777
Bug ID: 254777
Summary: REGRESSION: PostMessage with transfer object is broken
between contexts
Product: WebKit
Version: Safari 16
Hardware: All
OS: All
Status: NEW
Severity: Major
Priority: P2
Component: WebCore Misc.
Assignee: webkit-unassigned at lists.webkit.org
Reporter: tooker at gmail.com
Sending a transferable object like a MessagePort to communicate between different contexts no longer works properly. When I use the transfer argument to postMessage the event handler gets an event with a null data property.
Steps to reproduce:
1. Call postMessage({foo: 'bar', port}, self.origin, [port]) from page script.
2. Add window.message event handler to a different context such as an
extension's content script context and evaluate the event callback arg.
3. Observe the ev.data is null instead of {foo: 'bar', port: port}
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.
I first noticed this on the Orion Safari fork and filed a bug with them, https://orionfeedback.org/d/4730-postmessage-with-transfer-object-is-broken, but after updating to Safari 16.4 on the macOS 13.3 I see the same bug there, which leads me to believe this is a core WebKit regression. This is directly affecting my Safari extension which no longer works on anyone's 16.4 based Safari browsers. The same code works fine on all Chromium and Firefox.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230330/019f95c1/attachment.htm>
More information about the webkit-unassigned
mailing list