demo · v130
DocPiP bounds cache
Open a Document PiP window with or without preferInitialWindowPlacement: true. Without it, Chrome reuses the previous window size for this origin. With it, the size you request wins.
requires Document PiP
window.documentPictureInPicture is a desktop-only API; on mobile it returns false on feature-detect. The button below detects support and opens a real PiP window if available.
probing…
the code
const pip = await documentPictureInPicture.requestWindow({
width: 400,
height: 240,
preferInitialWindowPlacement: true, // NEW in v130 — ignore cached bounds
disallowReturnToOpener: false,
});
pip.document.body.append("Hello from DocPiP");