← Back to release summary

Document picture-in-picture: require user gesture for resize APIs

Category
Miscellaneous
Type
New or changed feature
Status
Enabled by default (Chrome 121)
Intent stage
None

WPT details: document-picture-in-picture/resize-requires-user-gesture.https.html

Summary

This enables the resizeBy() and resizeTo() Windows methods on document picture-in-picture windows, but with the added restriction of a user gesture requirement to mitigate the abuse potential

Motivation

The ability to programmatically resize a document picture-in-picture window is useful in a number of cases (e.g. the user expands a playlist feature, video content in the window changes size, the type/size of the content changes, etc). While resizeTo() and resizeBy() APIs already exist and solve this, they don't currently require a user gesture, and could be pretty strongly abused given the always-on-top nature of a document picture-in-picture window. By modifying these useful APIs to also require a gesture when used within a document picture-in-picture window, user agents can allow developers to make use of the APIs while limiting the abuse potential.

Standards & signals

Ecosystem

Samples: https://steimelchrome.github.io/document-pip/click_to_resize.html

View on chromestatus.com