From 4bb8e8319aa0aadd1b1ac9ac8a3f234982c8f172 Mon Sep 17 00:00:00 2001 From: Ade Bateman Date: Wed, 26 Apr 2017 18:30:13 -0700 Subject: [PATCH 1/2] Reject with SecurityError if the UA rejects the call to show(). Fixes #486. --- index.html | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index f7f88529..4d8565ff 100644 --- a/index.html +++ b/index.html @@ -623,6 +623,24 @@

  • Let request be the PaymentRequest object on which the method is called.
  • +
  • +

    + If the user agent rejects the call to show() to + protect the user, then return a promise rejected with a + "SecurityError" DOMException. For example, this + might occur if the user agent requires a user gesture to + allow a page to call show(), or the user agent may + limit the rate at which a page can call show(), as + described in the the privacy + considerations section. +

    +

    + Implementations are expected to experiment in this area. + Developers using the payment request API should investigate and + anticipate such experiments and understand under what + circumstances a SecurityError might occur. +

    +
  • If request.[[\state]] is not "created" then return a promise rejected with an "InvalidStateError" DOMException. @@ -798,8 +816,7 @@

    DOMException.

  • Optionally, at the user agent's discretion, return a - promise rejected with a "NotAllowedError" - DOMException. + promise rejected with a "NotAllowedError" DOMException.

    This allows user agents to apply heuristics to detect and prevent abuse of the canMakePayment() method for fingerprinting @@ -2677,7 +2694,7 @@

    -
    +

    Privacy Considerations

    From cd50c277906159d8b9095d4c22ddfce8e1e4ff0c Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Thu, 27 Apr 2017 14:38:06 -0400 Subject: [PATCH 2/2] Editorial tweaks --- index.html | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/index.html b/index.html index 4d8565ff..70101844 100644 --- a/index.html +++ b/index.html @@ -625,20 +625,20 @@

  • - If the user agent rejects the call to show() to - protect the user, then return a promise rejected with a - "SecurityError" DOMException. For example, this - might occur if the user agent requires a user gesture to - allow a page to call show(), or the user agent may - limit the rate at which a page can call show(), as - described in the the privacy - considerations section. + Optionally, if the user agent wishes to disallow the call + to show() to protect the user, then return a promise + rejected with a "SecurityError" DOMException. For + example, the user agent may require the call to be + triggered by user activation, or may limit the rate at + which a page can call show(), as described in the the + privacy considerations section.

    -

    +

    Implementations are expected to experiment in this area. Developers using the payment request API should investigate and anticipate such experiments and understand under what - circumstances a SecurityError might occur. + circumstances a "SecurityError" DOMException might + occur.

  • If request.[[\state]] is not "created" @@ -2771,6 +2771,10 @@

  • allowed to use
  • +
  • + triggered by + user activation +
  • in parallel