Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Picture-in-Picture / Always-on-top window #53

Open
cvzi opened this issue May 8, 2023 · 2 comments
Open

Picture-in-Picture / Always-on-top window #53

cvzi opened this issue May 8, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@cvzi
Copy link
Owner

cvzi commented May 8, 2023

In Chrome 111+ it's possible to show an always-on-top window with HTML content, previously only a video could be shown like this. This could be used to show the lyrics even if Youtube/Spotify tab is in the background.

A website that uses this:
https://lazy-guy.github.io/tomodoro/index.html

@cvzi cvzi added the enhancement New feature or request label May 8, 2023
@cyfung1031
Copy link
Collaborator

cyfung1031 commented May 11, 2023

Please be reminded that PIP requires user-interaction. You cannot suddenly popup that window without user clicking. (like auto lyrics)

And Firefox nevers support PIP.

@cyfung1031
Copy link
Collaborator

cyfung1031 commented May 11, 2023

YouTube uses popup window to do such kind of feature.

window.open(
  'https://github.com/cvzi/genius-lyrics-userscript/issues/53',
  '0.a.random.name', 
  'menubar=0,location=0,scrollbars=0,toolbar=0,width=600,height=600'
);
Screen Shot 2023-05-11 at 19 34 09

This will create a window object and you can use postMessage and addEventListener('message', ...) to communicate with the main window.
You can use that robots.txt to hack your script in that window, by detecting the window.name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants