Feature Policy: focus-without-user-activation
#10672
Open
+33
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
focus-without-user-activation
is a new feature policy that can be used to block programmatic focus changes that are not triggered through user activation (explainer).The motivation behind this feature policy is to provide better security for websites that embed third party contexts.
This change makes modifications to the following focus API:
autofocus
element.focus(options)
window.focus()
The WHATWG resolved to add a new feature policy,
focus-without-user-activation
, to control whether third-party iframes can take focus programmatically. (w3c/webappsec-permissions-policy#273 (comment))The original PR contains all prior discussions regarding the feature policy. However, since I don't have editor access to it, I've created this new PR.
focus-without-user-activation
feature policy mozilla/standards-positions#1080focus-without-user-activation
feature policy WebKit/standards-positions#406(See WHATWG Working Mode: Changes for more details.)
/acknowledgements.html ( diff )
/infrastructure.html ( diff )
/interaction.html ( diff )
/interactive-elements.html ( diff )
/popover.html ( diff )