Apparently this causes some weird issues regarding (mix) playlists. Pending some
further investigation into the true cause, the easiest solution seems to be to
disable this bit of code, seeing as it's currently not required for desktop
anyway.
We can't just detect m.youtube.com, though, because
a) embedded videos are always served from the main domain, and
b) mobile browsers visiting the desktop page (even in desktop mode) still
use the mobile video player with the background pausing behaviour (unless
they are completely spoofing their user agent).
so we need a slightly more complex solution.
For detecting whether we're running on Android or not we simply check the user
agent, as
1.) the Webextension API is async and therefore a pain to use here, and
2.) given point b) above, this neatly matches how Youtube presumably decides
whether to send users the desktop or mobile video player, so with any luck
we'd also correctly handle spoofed user agents, too.
For simple background playback, neither Youtube nor Vimeo require it at the
moment.
Vimeo also generally seems to stop playback on mobile when you exit fullscreen,
but to avoid this, it is enough to simply block the corresponding event. The
Fullscreen API properties themselves need to be left alone so that the
fullscreen button in the UI still works correctly.