prefer-initial-window-placement-manual.https.html (1198B)
1 <!DOCTYPE html> 2 <title>Test that using documentPictureInPicture's preferInitialWindowPlacement 3 parameter does not cache the window bounds</title> 4 <body> 5 <p> 6 This tests that a document picture-in-picture window opened with the `preferInitialWindowPlacement` 7 parameter set to `true` does not cache the previous window bounds when it is closed and reopened. 8 <ol> 9 <li>Click on the "Open document picture-in-picture window" button below.</li> 10 <li>Note its approximate position and size.</li> 11 <li>Move and resize the window.</li> 12 <li>Close the window.</li> 13 <li>Click the "Open document picture-in-picture window" button again.</li> 14 <li>Check that it opens in its original position and size, not where you resized / moved it to.</li> 15 </ol> 16 </p> 17 <input type="button" id="btnOpenPip" value="Open document picture-in-picture window" /> 18 <script> 19 const btnOpenPip = document.getElementById('btnOpenPip'); 20 btnOpenPip.addEventListener('click', async () => { 21 const pipWindow = await documentPictureInPicture.requestWindow({ preferInitialWindowPlacement: true }); 22 pipWindow.document.body.innerText = 'Move and resize this window!'; 23 }); 24 </script> 25 </body>