From 7cb82b9ed0ed0985809a13700efbf19d65ef2d22 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 When subscribe() is invoked in a window agent and the permission state is "prompt", check that we have user activation and consume it. (Unconditionally consuming requiring user activation is not deemed web compatible as websites often call this API repeatedly.) --- index.html | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/index.html b/index.html index a9a4c3a..2cc98f6 100644 --- a/index.html +++ b/index.html @@ -1200,6 +1200,21 @@

+
  • If |global| is a {{Window}} object: +
      +
    1. Let |permissionState| be "`push`"'s [=permission state=]. +
    2. +
    3. If |permissionState| is "`prompt`": +
        +
      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. +
      +
    4. +
    +
  • Run these steps [=in parallel=]:
    1. Let |subscription| be null. From 4f2f8ac76263f87529718a5a751fd9ed691dbf10 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Mon, 8 Dec 2025 10:11:15 +0100 Subject: [PATCH 2/2] queue --- index.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 2cc98f6..8b1ab1a 100644 --- a/index.html +++ b/index.html @@ -1206,8 +1206,9 @@

    2. If |permissionState| is "`prompt`":
        -
      1. If |global| does not have [=transient activation=], return [=a promise rejected - with=] with a {{"NotAllowedError"}} {{DOMException}}. +
      2. If |global| does not have [=transient activation=], then [=queue a global + task=] on the [=networking task source=] using |global| to [=reject=] |promise| + with a {{"NotAllowedError"}} {{DOMException}} and terminate these steps.
      3. [=Consume user activation=] of |global|.