Skip to content

Instantly share code, notes, and snippets.

@NightFeather
Last active August 6, 2023 06:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NightFeather/3b3860b314f156b4bc64a5ec23ec773f to your computer and use it in GitHub Desktop.
Save NightFeather/3b3860b314f156b4bc64a5ec23ec773f to your computer and use it in GitHub Desktop.
Stub some constant to make the video viewable on Firefox
// ==UserScript==
// @name Hololive FC Player Firefox Stub
// @namespace Violentmonkey Scripts
// @match https://hololive-fc.com/video/*
// @grant none
// @version 1.0
// @author Nightfeather
// @description 8/6/2023, 1:42:37 PM
// ==/UserScript==
/**
It looks like the video player it used is checking for PictureInPicture[^1] API, but firefox doesn't provided one atm,
makes it shows "This browser is not supported.".
But the player itself isn't configured to use this feature, so a fake class stub would work for me.
NOTE: THIS IS NOT A MEMBERSHIP BYPASS.
1: https://developer.mozilla.org/en-US/docs/Web/API/PictureInPictureWindow
*/
(() => {
function PictureInPictureWindow() { return this; }
function PictureInPictureEvent() { return this; }
Object.defineProperty(window, 'PictureInPictureWindow', {
value: PictureInPictureWindow,
writable: false
});
Object.defineProperty(window, 'PictureInPictureEvent', {
value: PictureInPictureEvent,
writable: false
})
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment