[Webkit-unassigned] [Bug 231167] New: MessagePort messages sent in iframe unload event not received

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Oct 4 05:16:21 PDT 2021


https://bugs.webkit.org/show_bug.cgi?id=231167

            Bug ID: 231167
           Summary: MessagePort messages sent in iframe unload event not
                    received
           Product: WebKit
           Version: Safari 15
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Frames
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: robertknight at gmail.com

Created attachment 440054

  --> https://bugs.webkit.org/attachment.cgi?id=440054&action=review

iframe unload notification test case

In the attached test case an iframe sends a notification to its parent frame via a) a MessagePort and b) `window.parent.postMessage` when it is unloaded. In Firefox and Chrome the messages sent via both methods are received in the parent frame. In Safari only the `window.parent.postMessage` events are received. The message sent via the MessagePort is not.

Steps to reproduce:

1. Load attached test case and click "Remove iframe" button

Console output in Chrome:

```
iframe received "pagehide" event
iframe received "visibilitychange" event
iframe received "unload" event
MessagePort in parent frame received message {trigger: 'pagehide'}
Parent frame received "message" event {trigger: 'pagehide'}
Parent frame received "message" event {trigger: 'visibilitychange'}
Parent frame received "message" event {trigger: 'unload'}
MessagePort in parent frame received message {trigger: 'visibilitychange'}
MessagePort in parent frame received message {trigger: 'unload'}
```

Firefox has the same output but with a slightly different order.

Console output in Safari 15:

```
iframe received "pagehide" event
iframe received "visibilitychange" event
iframe received "unload" event
Parent frame received "message" event – {trigger: "pagehide"}
Parent frame received "message" event – {trigger: "visibilitychange"}
Parent frame received "message" event – {trigger: "unload"}
```

-- 
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/20211004/279cd2b1/attachment-0001.htm>


More information about the webkit-unassigned mailing list