Force Facebook to play videos in background tab
7,391
Solution 1
I just enabled uBlock origin on Facebook again and now I can play videos in the background.
Seriously Facebook, what the hell?
Solution 2
Here's another simple workaround to execute in the dev console:
document.onblur = null
document.onvisibilitychange = null
Related videos on Youtube
Comments
-
shinzou over 1 year
Recently Facebook added a feature that if I play a video and switch to another tab or a different program from chrome, the video stops playing.
Is there a way to force it to keep playing?
I use Chrome and I don't have flash.
This is not enough to disable that feature:
document.addEventListener('visibilitychange', function(e){ e.stopPropagation(); e.preventDefault(); return false; })
-
Ravindra Bawane over 6 yearsDo you know the method Facebook uses to detect a tab is no longer in front? Have you tried a different browser?
-
shinzou over 6 yearsTheir code is obfuscated. And it looks like it doesn't happen on firefox. @music2myear
-
Ravindra Bawane over 6 yearsI'd guess it's javascript, though I suppose HTML5 may include the ability to query the tab state as well. Or, at least, it would surprise me if HTML5 lacked this.
-
shinzou over 6 yearsI had uBlock origin on firefox enabled and on chrome it was disabled on facebook, enabled it again and now this stupid feature doesn't work. @music2myear
-
-
Ravindra Bawane over 6 yearsWhy are you blaming Facebook? That's actually a rather convenient feature for most people. uBlock Origin is likely blocking the element(s) Facebook uses for the detection.
-
shinzou over 6 yearsBecause it's a very annoying feature that was obviously intended to make sure people actually watch ads, I just want to have a vid playing in the background and to listen to it, that's a fair expectation IMO, taking that option away is not cool.