7

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;
})
4
  • Do you know the method Facebook uses to detect a tab is no longer in front? Have you tried a different browser? Oct 27 '17 at 20:32
  • Their code is obfuscated. And it looks like it doesn't happen on firefox. @music2myear
    – shinzou
    Oct 27 '17 at 20:39
  • I'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. Oct 27 '17 at 20:50
  • I 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
    – shinzou
    Oct 27 '17 at 20:53
5

I just enabled uBlock origin on Facebook again and now I can play videos in the background.

Seriously Facebook, what the hell?

2
  • Why 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. Oct 27 '17 at 20:55
  • 5
    Because 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.
    – shinzou
    Oct 27 '17 at 21:48
2

Here's another simple workaround to execute in the dev console:

document.onblur = null
document.onvisibilitychange = null
-1

I developed chrome extension for this :) https://chrome.google.com/webstore/detail/facebook-allow-background/fkbfhbmobnjpcbpjegogifoeidhmnlel?hl=en

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.