From 9e0769a365ae246d5d8eb46d876c72c8840819e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Wed, 1 Jun 2022 13:39:35 +1000 Subject: [PATCH 1/2] check and consume user activation --- index.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 8b6511e..235152d 100644 --- a/index.html +++ b/index.html @@ -574,7 +574,12 @@

The subscribe() method when invoked MUST run the following steps:

    -
  1. Let |promise| be [=a new promise=]. +
  2. If the [=relevant global object=] of [=this=] does not have [=transient activation=], + return [=a promise rejected with=] with a {{"NotAllowedError"}} {{DOMException}}. +
  3. +
  4. [=Consume user activation=] of [=this=]'s [=relevant global object=]. +
  5. +
  6. Let |promise| be a new promise.
  7. Let |global| be [=this=]' [=relevant global object=].
  8. From bb5fb01fad2cc330ab6784ad535d853f474ab4f2 Mon Sep 17 00:00:00 2001 From: Marcos Caceres Date: Thu, 14 Dec 2023 16:36:01 +1100 Subject: [PATCH 2/2] Check if global is Window object --- index.html | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index 235152d..c32a059 100644 --- a/index.html +++ b/index.html @@ -574,15 +574,19 @@

    The subscribe() method when invoked MUST run the following steps:

      -
    1. If the [=relevant global object=] of [=this=] does not have [=transient activation=], - return [=a promise rejected with=] with a {{"NotAllowedError"}} {{DOMException}}. +
    2. Let |global| be the [=relevant global object=] of [=this=].
    3. -
    4. [=Consume user activation=] of [=this=]'s [=relevant global object=]. +
    5. If |global| is a {{Window}} object: +
        +
      1. If |global| does not have [=transient activation=], return [=a promise rejected + with=] with a {{"NotAllowedError"}} {{DOMException}}. +
      2. +
      3. [=Consume user activation=] of |global|. +
      4. +
    6. Let |promise| be a new promise.
    7. -
    8. Let |global| be [=this=]' [=relevant global object=]. -
    9. Return |promise| and continue [=in parallel=].