From ac6fe7a5b8b2218755a4766e77405bf9ae6cbf02 Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Fri, 5 Nov 2021 10:43:29 -0400 Subject: [PATCH] BroadcastChannel: Ignore msgs from detached iframes/closing workers For BroadcastChannel instances associated with detached iframes or closing workers, update the specification to require that calls to postMessage() should be ignored (without throwing an exception). Closes #7219. Some potential followup in #7253 for the related bfcache case. --- source | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/source b/source index 4eaf32f3cca..1694cffb080 100644 --- a/source +++ b/source @@ -101647,11 +101647,25 @@ interface BroadcastChannel : EventTarget { data-x="dom-BroadcastChannel-name">name getter steps are to return this's channel name.

+

A BroadcastChannel object is said to be eligible for messaging when + its relevant global object is either:

+ + +

The postMessage(message) method steps are:

    +
  1. If this is not eligible for messaging, then return.

  2. +
  3. If this's closed flag is true, then throw an "InvalidStateError" DOMException.

  4. @@ -101667,18 +101681,7 @@ interface BroadcastChannel : EventTarget { match the following criteria: