A new feature exists in chromium under an origin trial https://chromestatus.com/feature/5755179560337408
Probably should be treated like a popup.
onclick = async () => {
w = await documentPictureInPicture.requestWindow();
w.alert.call(window, 'hello world');
w.close();
}