Skip to content

Commit

Permalink
use pagehide
Browse files Browse the repository at this point in the history
  • Loading branch information
steimelchrome committed Oct 27, 2023
1 parent 99965f9 commit 95c378f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion autopip.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
 if (pipType == "document") {
   pipWindow = await documentPictureInPicture.requestWindow({width: 400, height: 400});
   pipWindow.document.body.append(video);
   pipWindow.addEventListener('unload', _ => {
   pipWindow.addEventListener('pagehide', _ => {
     videoContainer.append(video);
     pipWindow = null;
   });
Expand Down
2 changes: 1 addition & 1 deletion document-pip/video.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
onPipClosing(pipWindow);
}
pipWindow = newPipWindow;
pipWindow.addEventListener('unload', onPipClosing.bind(null, pipWindow));
pipWindow.addEventListener('pagehide', onPipClosing.bind(null, pipWindow));
btnClosePip.removeAttribute('disabled');
let pipDocument = pipWindow.document;
pipDocument.body.append(divContent);
Expand Down

0 comments on commit 95c378f

Please sign in to comment.