-
-
Notifications
You must be signed in to change notification settings - Fork 551
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
Update background.js keep focus/blur messaging to minimum #2375
Conversation
(merging untested) |
thank you so much for caring in depth! @raszpl (Did you check/compare the impact on each connected feature yet?)
Can we make up for that somehow (...?) have read alt+tab in our bug reports before
(good to know too. might soon have more auto pause options #2111) |
at least test if its not crashing :-)
I didnt change the mechanism in the end. Its doing exactly same thing old code was doing, just much less of it. Instead of spamming all unassociated (and hibernated) tabs with messages it now only sends it to YT tabs that send 'tab-connected' first and are still active.
Tried, failed, bug report suggest no one has a workaround. It is what it is. |
Hmm, still getting errors, but now it was one instance
after few hours |
spoilers - it was crashing :] #2380 |
some more people will already hopefully.
(could monitor alt+tab keyboard events.) |
so you didnt click the link and read that bug report :) |
Keep track of connected tabs. Send only to connected tabs, send only to at most TWO tabs, one losing focus and one gaining it.
I tried experimenting with local
as mentioned in #2375 but its much worse, clicking in browser address bar takes focus away and pauses videos :/. chrome.windows.onFocusChanged is only slightly better due to 10 year old Chrome bug https://issues.chromium.org/issues/41116352 :o Chrome doesnt tell us when user alt-tabs away. Firefox does send proper message and reacts to alt-tabbing just fine.
finally fixes #2284 . Tested in Chrome, Vivaldi and FF.