Propagate the user interaction flag through the resolve handler of the promise returned from hasStorageAccess as well

RESOLVED FIXED in Firefox 64

Status

()

enhancement
P3
normal
RESOLVED FIXED
7 months ago
2 months ago

People

(Reporter: Ehsan, Assigned: Ehsan)

Tracking

unspecified
mozilla64
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox64 fixed)

Details

Attachments

(1 attachment)

Assignee

Description

7 months ago
In addition to bug 1491403, there is another case for us to handle, I think.  What if someone has code like this:

onclick="foo()"

function foo() {
  document.hasStorageAccess()
          .then(success => {
            if (!success) {
              return document.requestStorageAccess();
            }
           });
}

In this case, the call to requestStorageAccess() will break because the resolve handler will have lost the user interaction flag by the time that it runs.
Assignee

Updated

7 months ago
Blocks: 1469714
Priority: -- → P2
Priority: P2 → P3
All this stuff depends on the user activation model we want. Google is proposing the very simple model, but I'm not sure how well that will work.
https://mustaqahmed.github.io/user-activation-v2/ is some version of that.
Assignee

Comment 2

7 months ago
Yes indeed.  Note that this is just an extension of the special hack we're adding for the storage access API while a general solution is being figured out.

Comment 4

7 months ago
Pushed by eakhgari@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a58c07d9a7fa
Ensure the promise returned from Document.hasStorageAccess() will propagate user activation r=baku

Comment 5

7 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/a58c07d9a7fa
Status: NEW → RESOLVED
Last Resolved: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
Component: DOM → DOM: Core & HTML
Product: Core → Core
You need to log in before you can comment on or make changes to this bug.