Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some mechanism to know that a message event was triggered by user activation #1983

Closed
RByers opened this issue Oct 27, 2016 · 17 comments
Closed
Labels
addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest topic: events topic: user activation

Comments

@RByers
Copy link

RByers commented Oct 27, 2016

The triggered by user activation logic allows for this state to flow between cross-origin iframes via postMessage. Unfortunately there's no good way for script to query whether it's currently in this state.

For example script in a trusted frame may want to respond to requests from an untrusted iframe (such as navigating to a new URL) only when the request from the iframe was initiated as a result of a user activation.

That is to say, there's no good reason the "triggered by user activation" logic should be available only to the user agent, script in other frames might want to depend on it for the exact same reasons. There's some discussion here, here and here about why this is particularly important for AMP. Today they're hacking around this in Chrome by attempting to write to the clipboard and seeing if that's successful to sniff that they're currently in the context of a user gesture. This is unfortunate because it potentially clobbers the clipboard and isn't necessarily interoperable. /cc @dvoytenko @cramforce.

Should we just add a boolean property like navigator.triggeredByUserActivation? Or should we perhaps define MessageEvent.isTrusted to be set to true when the script that invoked postMessage was itself triggered by user activation?

@cramforce
Copy link

I don't think we can use isTrusted on message events, because it is currently always true for all message events invoked via postMessage.

navigator.triggeredByUserActivation may leak the fact to other origins. A new property on MessageEvent might be better to delegate the knowledge of a user action by explicitly sending the message.

@RByers
Copy link
Author

RByers commented Oct 27, 2016

MessageEvent.triggeredByUserActivation (or some such) SGTM.

But can you elaborate on your "leak" concern? Isn't it fine for any origin to know at any time whether it's currently inside the context of "triggered by user activation" algorithm? It can figure that out already (at least in blink) by trying to write to the clipboard.

@domenic
Copy link
Member

domenic commented Oct 27, 2016

I don't see why we would make this MessageEvent-specific. After all it also flows through various other interesting things like setTimeouts and such.

@RByers
Copy link
Author

RByers commented Oct 27, 2016

Yeah, that was my thinking too. Malte makes a good point that this is probably mainly useful cross-document (because within a single document there's no security boundary - just like Event.isTrusted).

But I can imagine some scenarios where it's useful to know even within a document. For example, you want to do a window.open either directly or (if you can tell it'll get blocked) via some additional "click here to open" UI.

@cramforce
Copy link

I have no preference in API really. If we can make it work for setTimeout and friends that is cool, of course.

Exposing this will unlock a lot of use cases. For example it is rarely possible to use sandbox on iframe today without allowing allow-popups and allow-top-navigation. If user gestures were exposed, one could mandate to iframes: "Let me know when you would like to navigate via a message" and then the container can, for example, check whether the destination is acceptable, before executing the navigation on behalf of the child iframe.

In AMP we'd like to allow iframes to request resize in response to a user gesture, which is very similar.

@annevk
Copy link
Member

annevk commented Oct 27, 2016

If we expose it it should be exposed on the global I think since it's a task-annotation effectively. But I'm not sure we have described the underlying concept well enough to expose an API. E.g., integration with a theoretical interaction event specification is missing, setTimeout() forwarding is not defined. This new MessageEvent forwarding is not defined, etc.

@domenic
Copy link
Member

domenic commented Oct 27, 2016

Global sounds pretty reasonable to me. It also won't leak to other origins since it's not on the whitelist of cross-origin-accessible global properties. I guess it'd be only on Window, not on WorkerGlobalScopes.

@annevk we have a separate bug to define this better; #1903. Do you think straightening that out is a prerequisite to speccing/shipping an API that reflects it?

We also need multi-vendor interest, of course. I guess we should let this thread settle a bit further before we send up the signal flares in that direction though.

@domenic domenic added addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest topic: events labels Oct 27, 2016
@annevk
Copy link
Member

annevk commented Oct 28, 2016

Whether it needs to be exposed in workers depends on the semantics of what OP is requesting. Fairly easy to postMessage() to a worker. But if that message goes to a MessageChannel you would not know where it ends up and when it might be handled, so you'll have to deliminate that somehow.

I think whether I'm comfortable with just adding an API without corresponding architecture depends largely on how interoperable implementations are today. Extending it to messaging as requested by OP would require some suitable definition though as there's a myriad of interpretations possible.

@AshleyScirra
Copy link

I just want to pitch in and highlight the use case of using workers. With OffscreenCanvas it's now becoming feasible to run an entire game engine in a worker. However at the moment a game engine in a worker never has a user gesture. Considering some major features like starting audio playback are limited to user gestures, this issue amounts to blocking use of OffscreenCanvas for games.

This is complicated by the fact various APIs are unavailable in a worker. So playing audio when the user taps the screen would probably end up working like this:

"touchstart" event in main document -> postMessage() -> run game logic in worker -> postMessage() -> play audio in main document

For the audio playback to be allowed, the user gesture needs to be propagated through two separate postMessages(). Alternatively if the main document could "save" the user gesture to use it later, that could work too.

A related case is using user gestures with async code. For example if you want to prepare data to copy to the clipboard asynchronously, you can never copy it, because you lose the user gesture by the time the data is ready. I wrote more about this issue here: https://discourse.wicg.io/t/user-gesture-restrictions-and-async-code/1640

@RByers
Copy link
Author

RByers commented Jun 15, 2017

Thanks for the scenario! In chromium @mustaqahmed is experimenting with a simpler model for gestures that should solve most of what you've described.

Still, probably worth thinking specifically about explicit ways of passing 'activation' to a worker - I filed this chromium bug.

Is the ability to play audio in a Worker tracked anywhere? There's @hoch's AudioWorklet proposal, but I don't think the use case is the same there (in that case you really want your audio work isolated from the rest of the application, where you want it running on the same thread as your game logic). Also AFAIK WebAudio doesn't currently require a user gesture in chromium (though may in the future). Maybe you're talking about other ways of playing audio? /cc @rtoy

@hoch
Copy link
Contributor

hoch commented Jun 15, 2017

Now the AudioWorklet spec has become more than a proposal. Also we recently added the MessagePort between AudioWorkletNode and AudioWorkletProcessor. Perhaps this can be something to think about.

FWIW, there has been an attempt to support BaseAudioContext in worker scope, but it was pushed back to V2 spec. I believe this is the solution for @AshleyScirra's scenario. I am aware that it is really important for game engine developers, so I would love to support it sooner than later.

@AshleyScirra
Copy link

The difficult thing about audio playback is that while AudioContext works for a lot of things, it is designed around fully-decoded, fully-decompressed audio buffers. This is unsuitable for long music tracks, where HTMLAudioElement has a nice streaming capability. However being a DOM element it's difficult to see how it would ever run in a worker. Perhaps one day MediaStreams will even be transferrable to a worker, but even then you still need a play() call on a DOM element that would have to obey user gesture restrictions.

@dtapuska
Copy link
Contributor

I've posted my proposal here: https://github.com/dtapuska/useractivation
TLDR: add navigator.userActivation and message.userActivation

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Jun 27, 2018
Add a variable on the navigator object to query whether the frame has
seen a user activation ever.

The postMessage part of the proposal will be done in a separate patch,
this change is limited to just adding the object definition and
exposing it on navigator.

https://github.com/dtapuska/useractivation
whatwg/html#1983

BUG=846858

Change-Id: I6ca4c80f4096bfae9ca13b175b46df6b4486a6dd
@domenic
Copy link
Member

domenic commented Jun 27, 2018

Thanks! I'm pretty happy with the proposal myself. And I remain hopeful that we can add something here even before we fix the interop problems around user activation (#1903); the basic functionality, of knowing whether user activation is currently in progress, or has at some point happened, should survive any future modifications.

Looking back at earlier parts of the thread, it seems like some of @annevk's concerns were around how this fits with postMessage and message-passing. I think @dtapuska's proposal addresses that pretty elegantly, with the opt-in at message time capturing the state of the window posting the message. I'm curious to hear others' thoughts.

@RByers
Copy link
Author

RByers commented Jun 27, 2018

I'm curious to hear others' thoughts.

As long as folks are convinced it's really best for this to be sender opt-in, then I'm happy with @dtapuska's proposal!

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Jun 28, 2018
Add a variable on the navigator object to query whether the frame has
seen a user activation ever.

The postMessage part of the proposal will be done in a separate patch,
this change is limited to just adding the object definition and
exposing it on navigator.

https://github.com/dtapuska/useractivation
whatwg/html#1983

BUG=846858

Change-Id: I6ca4c80f4096bfae9ca13b175b46df6b4486a6dd
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Jul 4, 2018
Add a variable on the navigator object to query whether the frame has
seen a user activation ever.

The postMessage part of the proposal will be done in a separate patch,
this change is limited to just adding the object definition and
exposing it on navigator.

https://github.com/dtapuska/useractivation
whatwg/html#1983

BUG=846858

Change-Id: I6ca4c80f4096bfae9ca13b175b46df6b4486a6dd
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Jul 5, 2018
Add a variable on the navigator object to query whether the frame has
seen a user activation ever.

The postMessage part of the proposal will be done in a separate patch,
this change is limited to just adding the object definition and
exposing it on navigator.

https://github.com/dtapuska/useractivation
whatwg/html#1983

BUG=846858

Change-Id: I6ca4c80f4096bfae9ca13b175b46df6b4486a6dd
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Jul 5, 2018
Add a variable on the navigator object to query whether the frame has
seen a user activation ever.

The postMessage part of the proposal will be done in a separate patch,
this change is limited to just adding the object definition and
exposing it on navigator.

https://github.com/dtapuska/useractivation
whatwg/html#1983

BUG=846858

Change-Id: I6ca4c80f4096bfae9ca13b175b46df6b4486a6dd
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Jul 5, 2018
Add a variable on the navigator object to query whether the frame has
seen a user activation ever.

The postMessage part of the proposal will be done in a separate patch,
this change is limited to just adding the object definition and
exposing it on navigator.

https://github.com/dtapuska/useractivation
whatwg/html#1983

BUG=846858

Change-Id: I6ca4c80f4096bfae9ca13b175b46df6b4486a6dd
aarongable pushed a commit to chromium/chromium that referenced this issue Jul 5, 2018
Add a variable on the navigator object to query whether the frame has
seen a user activation ever.

The postMessage part of the proposal will be done in a separate patch,
this change is limited to just adding the object definition and
exposing it on navigator.

https://github.com/dtapuska/useractivation
whatwg/html#1983

BUG=846858

Change-Id: I6ca4c80f4096bfae9ca13b175b46df6b4486a6dd
Reviewed-on: https://chromium-review.googlesource.com/1076979
Commit-Queue: Dave Tapuska <[email protected]>
Reviewed-by: Rick Byers <[email protected]>
Reviewed-by: Mustaq Ahmed <[email protected]>
Cr-Commit-Position: refs/heads/master@{#572847}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Jul 5, 2018
Add a variable on the navigator object to query whether the frame has
seen a user activation ever.

The postMessage part of the proposal will be done in a separate patch,
this change is limited to just adding the object definition and
exposing it on navigator.

https://github.com/dtapuska/useractivation
whatwg/html#1983

BUG=846858

Change-Id: I6ca4c80f4096bfae9ca13b175b46df6b4486a6dd
Reviewed-on: https://chromium-review.googlesource.com/1076979
Commit-Queue: Dave Tapuska <[email protected]>
Reviewed-by: Rick Byers <[email protected]>
Reviewed-by: Mustaq Ahmed <[email protected]>
Cr-Commit-Position: refs/heads/master@{#572847}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Jul 5, 2018
Add a variable on the navigator object to query whether the frame has
seen a user activation ever.

The postMessage part of the proposal will be done in a separate patch,
this change is limited to just adding the object definition and
exposing it on navigator.

https://github.com/dtapuska/useractivation
whatwg/html#1983

BUG=846858

Change-Id: I6ca4c80f4096bfae9ca13b175b46df6b4486a6dd
Reviewed-on: https://chromium-review.googlesource.com/1076979
Commit-Queue: Dave Tapuska <[email protected]>
Reviewed-by: Rick Byers <[email protected]>
Reviewed-by: Mustaq Ahmed <[email protected]>
Cr-Commit-Position: refs/heads/master@{#572847}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Jul 11, 2018
…as seen a user gesture., a=testonly

Automatic update from web-platform-testsAdd an API to query whether the window has seen a user gesture.

Add a variable on the navigator object to query whether the frame has
seen a user activation ever.

The postMessage part of the proposal will be done in a separate patch,
this change is limited to just adding the object definition and
exposing it on navigator.

https://github.com/dtapuska/useractivation
whatwg/html#1983

BUG=846858

Change-Id: I6ca4c80f4096bfae9ca13b175b46df6b4486a6dd
Reviewed-on: https://chromium-review.googlesource.com/1076979
Commit-Queue: Dave Tapuska <[email protected]>
Reviewed-by: Rick Byers <[email protected]>
Reviewed-by: Mustaq Ahmed <[email protected]>
Cr-Commit-Position: refs/heads/master@{#572847}

--

wpt-commits: dfca5197519caef6c189636b5d80b33e3424e91e
wpt-pr: 11361
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Jul 24, 2018
Add an API to query user activation state on a posted message event.
Add includeUserActivation attribute on the WindowPostMessageOptions so
that indication of user gesture behavior can be opted in.

https://github.com/dtapuska/useractivation
whatwg/html#1983

BUG=846858

Change-Id: I2459b21004afbe00c41ddf992533c60728768bb4
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Jul 27, 2018
Add an API to query user activation state on a posted message event.
Add includeUserActivation attribute on the WindowPostMessageOptions so
that indication of user gesture behavior can be opted in.

https://github.com/dtapuska/useractivation
whatwg/html#1983

BUG=846858

Change-Id: I2459b21004afbe00c41ddf992533c60728768bb4
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Jul 27, 2018
Add an API to query user activation state on a posted message event.
Add includeUserActivation attribute on the WindowPostMessageOptions so
that indication of user gesture behavior can be opted in.

https://github.com/dtapuska/useractivation
whatwg/html#1983

BUG=846858

Change-Id: I2459b21004afbe00c41ddf992533c60728768bb4
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Jul 30, 2018
Add an API to query user activation state on a posted message event.
Add includeUserActivation attribute on the WindowPostMessageOptions so
that indication of user gesture behavior can be opted in.

https://github.com/dtapuska/useractivation
whatwg/html#1983

BUG=846858

Change-Id: I2459b21004afbe00c41ddf992533c60728768bb4
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Jul 30, 2018
Add an API to query user activation state on a posted message event.
Add includeUserActivation attribute on the WindowPostMessageOptions so
that indication of user gesture behavior can be opted in.

https://github.com/dtapuska/useractivation
whatwg/html#1983

BUG=846858

Change-Id: I2459b21004afbe00c41ddf992533c60728768bb4
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Jul 30, 2018
Add an API to query user activation state on a posted message event.
Add includeUserActivation attribute on the WindowPostMessageOptions so
that indication of user gesture behavior can be opted in.

https://github.com/dtapuska/useractivation
whatwg/html#1983

BUG=846858

Change-Id: I2459b21004afbe00c41ddf992533c60728768bb4
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Jul 30, 2018
Add an API to query user activation state on a posted message event.
Add includeUserActivation attribute on the WindowPostMessageOptions so
that indication of user gesture behavior can be opted in.

https://github.com/dtapuska/useractivation
whatwg/html#1983

BUG=846858

Change-Id: I2459b21004afbe00c41ddf992533c60728768bb4
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Jul 31, 2018
Add an API to query user activation state on a posted message event.
Add includeUserActivation attribute on the WindowPostMessageOptions so
that indication of user gesture behavior can be opted in.

https://github.com/dtapuska/useractivation
whatwg/html#1983

BUG=846858

Change-Id: I2459b21004afbe00c41ddf992533c60728768bb4
aarongable pushed a commit to chromium/chromium that referenced this issue Jul 31, 2018
Add an API to query user activation state on a posted message event.
Add includeUserActivation attribute on the WindowPostMessageOptions so
that indication of user gesture behavior can be opted in.

https://github.com/dtapuska/useractivation
whatwg/html#1983

BUG=846858
[email protected]

Change-Id: I2459b21004afbe00c41ddf992533c60728768bb4
Reviewed-on: https://chromium-review.googlesource.com/1131558
Commit-Queue: Dave Tapuska <[email protected]>
Reviewed-by: Ken Buchanan <[email protected]>
Reviewed-by: Marijn Kruisselbrink <[email protected]>
Cr-Commit-Position: refs/heads/master@{#579398}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Jul 31, 2018
Add an API to query user activation state on a posted message event.
Add includeUserActivation attribute on the WindowPostMessageOptions so
that indication of user gesture behavior can be opted in.

https://github.com/dtapuska/useractivation
whatwg/html#1983

BUG=846858
[email protected]

Change-Id: I2459b21004afbe00c41ddf992533c60728768bb4
Reviewed-on: https://chromium-review.googlesource.com/1131558
Commit-Queue: Dave Tapuska <[email protected]>
Reviewed-by: Ken Buchanan <[email protected]>
Reviewed-by: Marijn Kruisselbrink <[email protected]>
Cr-Commit-Position: refs/heads/master@{#579398}
pull bot pushed a commit to hoojaoh/web-platform-tests that referenced this issue Jul 31, 2018
Add an API to query user activation state on a posted message event.
Add includeUserActivation attribute on the WindowPostMessageOptions so
that indication of user gesture behavior can be opted in.

https://github.com/dtapuska/useractivation
whatwg/html#1983

BUG=846858
[email protected]

Change-Id: I2459b21004afbe00c41ddf992533c60728768bb4
Reviewed-on: https://chromium-review.googlesource.com/1131558
Commit-Queue: Dave Tapuska <[email protected]>
Reviewed-by: Ken Buchanan <[email protected]>
Reviewed-by: Marijn Kruisselbrink <[email protected]>
Cr-Commit-Position: refs/heads/master@{#579398}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Aug 3, 2018
…t, a=testonly

Automatic update from web-platform-testsAdd UserActivation member to MessageEvent

Add an API to query user activation state on a posted message event.
Add includeUserActivation attribute on the WindowPostMessageOptions so
that indication of user gesture behavior can be opted in.

https://github.com/dtapuska/useractivation
whatwg/html#1983

BUG=846858
[email protected]

Change-Id: I2459b21004afbe00c41ddf992533c60728768bb4
Reviewed-on: https://chromium-review.googlesource.com/1131558
Commit-Queue: Dave Tapuska <[email protected]>
Reviewed-by: Ken Buchanan <[email protected]>
Reviewed-by: Marijn Kruisselbrink <[email protected]>
Cr-Commit-Position: refs/heads/master@{#579398}

--

wpt-commits: 8a1d5c110779c525257fe2305ba7a21ae6e969e6
wpt-pr: 12157
jankeromnes pushed a commit to jankeromnes/gecko that referenced this issue Aug 3, 2018
…t, a=testonly

Automatic update from web-platform-testsAdd UserActivation member to MessageEvent

Add an API to query user activation state on a posted message event.
Add includeUserActivation attribute on the WindowPostMessageOptions so
that indication of user gesture behavior can be opted in.

https://github.com/dtapuska/useractivation
whatwg/html#1983

BUG=846858
[email protected]

Change-Id: I2459b21004afbe00c41ddf992533c60728768bb4
Reviewed-on: https://chromium-review.googlesource.com/1131558
Commit-Queue: Dave Tapuska <[email protected]>
Reviewed-by: Ken Buchanan <[email protected]>
Reviewed-by: Marijn Kruisselbrink <[email protected]>
Cr-Commit-Position: refs/heads/master@{#579398}

--

wpt-commits: 8a1d5c110779c525257fe2305ba7a21ae6e969e6
wpt-pr: 12157
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Oct 3, 2019
…as seen a user gesture., a=testonly

Automatic update from web-platform-testsAdd an API to query whether the window has seen a user gesture.

Add a variable on the navigator object to query whether the frame has
seen a user activation ever.

The postMessage part of the proposal will be done in a separate patch,
this change is limited to just adding the object definition and
exposing it on navigator.

https://github.com/dtapuska/useractivation
whatwg/html#1983

BUG=846858

Change-Id: I6ca4c80f4096bfae9ca13b175b46df6b4486a6dd
Reviewed-on: https://chromium-review.googlesource.com/1076979
Commit-Queue: Dave Tapuska <dtapuskachromium.org>
Reviewed-by: Rick Byers <rbyerschromium.org>
Reviewed-by: Mustaq Ahmed <mustaqchromium.org>
Cr-Commit-Position: refs/heads/master{#572847}

--

wpt-commits: dfca5197519caef6c189636b5d80b33e3424e91e
wpt-pr: 11361

UltraBlame original commit: 6ca48fa9e7f0348e0c84196f401467f3afcc5835
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Oct 3, 2019
…as seen a user gesture., a=testonly

Automatic update from web-platform-testsAdd an API to query whether the window has seen a user gesture.

Add a variable on the navigator object to query whether the frame has
seen a user activation ever.

The postMessage part of the proposal will be done in a separate patch,
this change is limited to just adding the object definition and
exposing it on navigator.

https://github.com/dtapuska/useractivation
whatwg/html#1983

BUG=846858

Change-Id: I6ca4c80f4096bfae9ca13b175b46df6b4486a6dd
Reviewed-on: https://chromium-review.googlesource.com/1076979
Commit-Queue: Dave Tapuska <dtapuskachromium.org>
Reviewed-by: Rick Byers <rbyerschromium.org>
Reviewed-by: Mustaq Ahmed <mustaqchromium.org>
Cr-Commit-Position: refs/heads/master{#572847}

--

wpt-commits: dfca5197519caef6c189636b5d80b33e3424e91e
wpt-pr: 11361

UltraBlame original commit: 6ca48fa9e7f0348e0c84196f401467f3afcc5835
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Oct 3, 2019
…t, a=testonly

Automatic update from web-platform-testsAdd UserActivation member to MessageEvent

Add an API to query user activation state on a posted message event.
Add includeUserActivation attribute on the WindowPostMessageOptions so
that indication of user gesture behavior can be opted in.

https://github.com/dtapuska/useractivation
whatwg/html#1983

BUG=846858
TBR=mkwstchromium.org

Change-Id: I2459b21004afbe00c41ddf992533c60728768bb4
Reviewed-on: https://chromium-review.googlesource.com/1131558
Commit-Queue: Dave Tapuska <dtapuskachromium.org>
Reviewed-by: Ken Buchanan <kenrbchromium.org>
Reviewed-by: Marijn Kruisselbrink <mekchromium.org>
Cr-Commit-Position: refs/heads/master{#579398}

--

wpt-commits: 8a1d5c110779c525257fe2305ba7a21ae6e969e6
wpt-pr: 12157

UltraBlame original commit: 81d76d4b48a5764ebf503172672b563f1f655595
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Oct 3, 2019
…as seen a user gesture., a=testonly

Automatic update from web-platform-testsAdd an API to query whether the window has seen a user gesture.

Add a variable on the navigator object to query whether the frame has
seen a user activation ever.

The postMessage part of the proposal will be done in a separate patch,
this change is limited to just adding the object definition and
exposing it on navigator.

https://github.com/dtapuska/useractivation
whatwg/html#1983

BUG=846858

Change-Id: I6ca4c80f4096bfae9ca13b175b46df6b4486a6dd
Reviewed-on: https://chromium-review.googlesource.com/1076979
Commit-Queue: Dave Tapuska <dtapuskachromium.org>
Reviewed-by: Rick Byers <rbyerschromium.org>
Reviewed-by: Mustaq Ahmed <mustaqchromium.org>
Cr-Commit-Position: refs/heads/master{#572847}

--

wpt-commits: dfca5197519caef6c189636b5d80b33e3424e91e
wpt-pr: 11361

UltraBlame original commit: 6ca48fa9e7f0348e0c84196f401467f3afcc5835
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Oct 3, 2019
…t, a=testonly

Automatic update from web-platform-testsAdd UserActivation member to MessageEvent

Add an API to query user activation state on a posted message event.
Add includeUserActivation attribute on the WindowPostMessageOptions so
that indication of user gesture behavior can be opted in.

https://github.com/dtapuska/useractivation
whatwg/html#1983

BUG=846858
TBR=mkwstchromium.org

Change-Id: I2459b21004afbe00c41ddf992533c60728768bb4
Reviewed-on: https://chromium-review.googlesource.com/1131558
Commit-Queue: Dave Tapuska <dtapuskachromium.org>
Reviewed-by: Ken Buchanan <kenrbchromium.org>
Reviewed-by: Marijn Kruisselbrink <mekchromium.org>
Cr-Commit-Position: refs/heads/master{#579398}

--

wpt-commits: 8a1d5c110779c525257fe2305ba7a21ae6e969e6
wpt-pr: 12157

UltraBlame original commit: 81d76d4b48a5764ebf503172672b563f1f655595
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Oct 3, 2019
…t, a=testonly

Automatic update from web-platform-testsAdd UserActivation member to MessageEvent

Add an API to query user activation state on a posted message event.
Add includeUserActivation attribute on the WindowPostMessageOptions so
that indication of user gesture behavior can be opted in.

https://github.com/dtapuska/useractivation
whatwg/html#1983

BUG=846858
TBR=mkwstchromium.org

Change-Id: I2459b21004afbe00c41ddf992533c60728768bb4
Reviewed-on: https://chromium-review.googlesource.com/1131558
Commit-Queue: Dave Tapuska <dtapuskachromium.org>
Reviewed-by: Ken Buchanan <kenrbchromium.org>
Reviewed-by: Marijn Kruisselbrink <mekchromium.org>
Cr-Commit-Position: refs/heads/master{#579398}

--

wpt-commits: 8a1d5c110779c525257fe2305ba7a21ae6e969e6
wpt-pr: 12157

UltraBlame original commit: 81d76d4b48a5764ebf503172672b563f1f655595
@mustaqahmed
Copy link
Contributor

The first part of this issue (adding a navigator interface) is covered in #4008, and we currently have PR #8254 under review for that part.

domenic pushed a commit that referenced this issue Sep 14, 2022
This allows querying both sticky and transient user activation state.

Fixes #4008. Closes #4009 by superseding it.

See #1983 (which remains open) and https://github.com/dtapuska/useractivation for another related API proposal, for sending user activation state along with message events.

Co-authored-by: Dave Tapuska <[email protected]>
@annevk
Copy link
Member

annevk commented Sep 30, 2022

Let's consider this resolved. If there's still a need for message-event API that can be discussed in a new issue as a lot of things changed since 2016.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest topic: events topic: user activation
Development

No branches or pull requests

8 participants