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
Replace activate event listener with onfocus #13
Conversation
Forget everything that I said earlier (the solution was as simple as replacing Safari's |
A bit unrelated, but you should change the icon for the YouTube player with Google's own Material Design PiP icon (https://design.google.com/icons/#ic_picture_in_picture_alt) |
How did you run in problems with the current code? I tested it quiet a time and it was alright even on tab change. So I lost a bit track of the recent changes 😂 |
The first issue was that the Secondly, for some reason the toolbar didn't seem to update if a change happened extremely quickly, and removing the |
Huh, it seems like the extension doesn't like iframes atm, so I don't think you should merge right now (I'll fix it and tell you when it's done). |
I think that the iframe identifies itself as an entirely different |
Do you have an example where it currently won't work with an iFrame embedded video? |
Look at this article on macstories.net - the PiP button flickers on and off depending on whether its video is in focus (without the check). If you add back the check it works fine, but it is still unresponsive on some websites. |
I'm reopening the PR now, because I fixed the issue (by adding the check back, but tweaking it a bit). Also, I've done a bit more cleanup. |
As part of the cleanup, I've also removed the team ID from the |
Just merged your PR and added some more features! Great work! |
For some reason, the
activate
event listener is not being called due to which the only way to validate the toolbar button when the tab is switched is via the MutationObserver. However, thanks to the checks that I had put in place earlier, the JS would not tell the Swift code to validate it since it had already told it to do so before.I have fixed this by removing the check entirely, although you should revert this PR if you figure out how to make the
activate
event listener work.