Conversation
|
Preparing a WPTest... |
|
I'm not sure this is Web compatible -
|
|
Note that Gecko opted to require user activation only if the permission is not granted, and just proceeds without activation if it's granted, which I think is the best way as reportedly some websites repeatedly calls
|
da81596 to
bb5fb01
Compare
|
I'll take a closer look at what WebKit does... we might be doing something similar @saschanaz. |
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
Outdated
| </li> | ||
| <li>If |permissionState| is "`prompt`": | ||
| <ol> | ||
| <li>If |global| does not have [=transient activation=], return [=a promise rejected |
There was a problem hiding this comment.
The Gecko implementation is more like saving the transient activation state and use that info later in async, but maybe that's a bit unusual to specify?
There was a problem hiding this comment.
What happens if someone else consumes it meanwhile?
There was a problem hiding this comment.
Ah yes, we only check the activation but doesn't really consume it, that's why we can do that. Certainly things would change when we consume it.
There was a problem hiding this comment.
I should queue a task here and not just return a fresh promise. I do think we want to consume immediately and not from a task. Otherwise it's not very predictable for web developers.
Closes #346
The following tasks have been completed:
Implementation commitment:
Preview | Diff