Source code

Revision control

Copy as Markdown

Other Tools

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
/* globals browser */
let AVAILABLE_PIP_OVERRIDES;
{
// See PictureInPictureControls.sys.mjs for these values.
// eslint-disable-next-line no-unused-vars
const TOGGLE_POLICIES = browser.pictureInPictureChild.getPolicies();
const KEYBOARD_CONTROLS = browser.pictureInPictureChild.getKeyboardControls();
AVAILABLE_PIP_OVERRIDES = {
// The keys of this object are match patterns for URLs, as documented in
//
// Example:
// const KEYBOARD_CONTROLS = browser.pictureInPictureChild.getKeyboardControls();
//
//
// policy: TOGGLE_POLICIES.THREE_QUARTERS,
// disabledKeyboardControls: KEYBOARD_CONTROLS.PLAY_PAUSE | KEYBOARD_CONTROLS.VOLUME,
// },
// policy: TOGGLE_POLICIES.TOP,
// disabledKeyboardControls: KEYBOARD_CONTROLS.ALL,
// },
tests: {
// FOR TESTS ONLY!
{
videoWrapperScriptPath: "video-wrappers/mock-wrapper.js",
},
{
videoWrapperScriptPath: "video-wrappers/mock-wrapper.js",
},
},
abcnews: {
videoWrapperScriptPath: "video-wrappers/videojsWrapper.js",
},
},
airmozilla: {
videoWrapperScriptPath: "video-wrappers/airmozilla.js",
},
},
aol: {
videoWrapperScriptPath: "video-wrappers/videojsWrapper.js",
},
},
arte: {
videoWrapperScriptPath: "video-wrappers/videojsWrapper.js",
},
},
bbc: {
videoWrapperScriptPath: "video-wrappers/bbc.js",
},
videoWrapperScriptPath: "video-wrappers/bbc.js",
},
},
brightcove: {
videoWrapperScriptPath: "video-wrappers/videojsWrapper.js",
},
},
canalplus: {
videoWrapperScriptPath: "video-wrappers/canalplus.js",
disabledKeyboardControls: KEYBOARD_CONTROLS.LIVE_SEEK,
},
videoWrapperScriptPath: "video-wrappers/canalplus.js",
},
},
cbc: {
videoWrapperScriptPath: "video-wrappers/cbc.js",
},
},
cnbc: {
videoWrapperScriptPath: "video-wrappers/jwplayerWrapper.js",
},
},
cpac: {
videoWrapperScriptPath: "video-wrappers/jwplayerWrapper.js",
},
},
cspan: {
videoWrapperScriptPath: "video-wrappers/jwplayerWrapper.js",
},
},
dailymotion: {
videoWrapperScriptPath: "video-wrappers/dailymotion.js",
},
},
disneyplus: {
videoWrapperScriptPath: "video-wrappers/disneyplus.js",
},
},
edx: {
videoWrapperScriptPath: "video-wrappers/edx.js",
},
},
fandom: {
videoWrapperScriptPath: "video-wrappers/jwplayerWrapper.js",
},
},
fastcompany: {
videoWrapperScriptPath: "video-wrappers/jwplayerWrapper.js",
},
},
frontendMasters: {
videoWrapperScriptPath: "video-wrappers/videojsWrapper.js",
},
},
funimation: {
videoWrapperScriptPath: "video-wrappers/videojsWrapper.js",
},
},
fuse: {
videoWrapperScriptPath: "video-wrappers/jwplayerWrapper.js",
},
},
hbomax: {
"https://play.hbomax.com/page/*": { policy: TOGGLE_POLICIES.HIDDEN },
videoWrapperScriptPath: "video-wrappers/hbomax.js",
},
},
hotstar: {
videoWrapperScriptPath: "video-wrappers/hotstar.js",
},
},
hulu: {
policy: TOGGLE_POLICIES.ONE_QUARTER,
videoWrapperScriptPath: "video-wrappers/hulu.js",
},
},
imdb: {
videoWrapperScriptPath: "video-wrappers/jwplayerWrapper.js",
},
},
indpendentuk: {
videoWrapperScriptPath: "video-wrappers/jwplayerWrapper.js",
},
},
indy100: {
videoWrapperScriptPath: "video-wrappers/jwplayerWrapper.js",
},
},
instagram: {
"https://www.instagram.com/*": { policy: TOGGLE_POLICIES.ONE_QUARTER },
},
internetArchive: {
videoWrapperScriptPath: "video-wrappers/jwplayerWrapper.js",
},
},
laracasts: {
"https://*.laracasts.com/*": { policy: TOGGLE_POLICIES.ONE_QUARTER },
},
msn: {
visibilityThreshold: 0.7,
},
},
msnbc: {
videoWrapperScriptPath: "video-wrappers/jwplayerWrapper.js",
},
},
mxplayer: {
videoWrapperScriptPath: "video-wrappers/videojsWrapper.js",
},
},
nbcnews: {
videoWrapperScriptPath: "video-wrappers/jwplayerWrapper.js",
},
},
nbcUniversal: {
videoWrapperScriptPath: "video-wrappers/jwplayerWrapper.js",
},
},
nebula: {
videoWrapperScriptPath: "video-wrappers/videojsWrapper.js",
},
},
netflix: {
videoWrapperScriptPath: "video-wrappers/netflix.js",
},
"https://*.netflix.com/browse*": { policy: TOGGLE_POLICIES.HIDDEN },
"https://*.netflix.com/latest*": { policy: TOGGLE_POLICIES.HIDDEN },
"https://*.netflix.com/Kids*": { policy: TOGGLE_POLICIES.HIDDEN },
"https://*.netflix.com/title*": { policy: TOGGLE_POLICIES.HIDDEN },
"https://*.netflix.com/notification*": { policy: TOGGLE_POLICIES.HIDDEN },
"https://*.netflix.com/search*": { policy: TOGGLE_POLICIES.HIDDEN },
},
nytimes: {
videoWrapperScriptPath: "video-wrappers/nytimes.js",
},
},
pbs: {
videoWrapperScriptPath: "video-wrappers/videojsWrapper.js",
},
videoWrapperScriptPath: "video-wrappers/videojsWrapper.js",
},
},
piped: {
videoWrapperScriptPath: "video-wrappers/piped.js",
},
videoWrapperScriptPath: "video-wrappers/piped.js",
},
},
primeVideo: {
visibilityThreshold: 0.9,
videoWrapperScriptPath: "video-wrappers/primeVideo.js",
},
visibilityThreshold: 0.9,
videoWrapperScriptPath: "video-wrappers/primeVideo.js",
},
},
radiocanada: {
videoWrapperScriptPath: "video-wrappers/radiocanada.js",
},
},
reddit: {
"https://*.reddit.com/*": { policy: TOGGLE_POLICIES.ONE_QUARTER },
},
reuters: {
videoWrapperScriptPath: "video-wrappers/jwplayerWrapper.js",
},
},
sonyliv: {
videoWrapperScriptPath: "video-wrappers/sonyliv.js",
},
},
syfy: {
videoWrapperScriptPath: "video-wrappers/jwplayerWrapper.js",
},
},
ted: {
showHiddenTextTracks: true,
},
},
time: {
videoWrapperScriptPath: "video-wrappers/jwplayerWrapper.js",
},
},
timvision: {
videoWrapperScriptPath: "video-wrappers/canalplus.js",
disabledKeyboardControls: KEYBOARD_CONTROLS.LIVE_SEEK,
},
videoWrapperScriptPath: "video-wrappers/canalplus.js",
},
},
tubi: {
videoWrapperScriptPath: "video-wrappers/tubilive.js",
},
videoWrapperScriptPath: "video-wrappers/tubi.js",
},
videoWrapperScriptPath: "video-wrappers/tubi.js",
},
},
twitch: {
videoWrapperScriptPath: "video-wrappers/twitch.js",
policy: TOGGLE_POLICIES.ONE_QUARTER,
disabledKeyboardControls: KEYBOARD_CONTROLS.LIVE_SEEK,
},
videoWrapperScriptPath: "video-wrappers/twitch.js",
policy: TOGGLE_POLICIES.ONE_QUARTER,
disabledKeyboardControls: KEYBOARD_CONTROLS.LIVE_SEEK,
},
videoWrapperScriptPath: "video-wrappers/twitch.js",
policy: TOGGLE_POLICIES.ONE_QUARTER,
disabledKeyboardControls: KEYBOARD_CONTROLS.LIVE_SEEK,
},
},
udemy: {
videoWrapperScriptPath: "video-wrappers/udemy.js",
policy: TOGGLE_POLICIES.ONE_QUARTER,
},
},
univision: {
videoWrapperScriptPath: "video-wrappers/jwplayerWrapper.js",
},
},
viki: {
videoWrapperScriptPath: "video-wrappers/videojsWrapper.js",
},
},
vimeo: {
showHiddenTextTracks: true,
},
},
voot: {
videoWrapperScriptPath: "video-wrappers/voot.js",
},
},
wired: {
videoWrapperScriptPath: "video-wrappers/videojsWrapper.js",
},
},
yahoo: {
videoWrapperScriptPath: "video-wrappers/videojsWrapper.js",
},
},
youtube: {
/**
* The threshold of 0.7 is so that users can click on the "Skip Ads"
* button on the YouTube site player without accidentally triggering
* PiP.
*/
visibilityThreshold: 0.7,
videoWrapperScriptPath: "video-wrappers/youtube.js",
},
visibilityThreshold: 0.9,
videoWrapperScriptPath: "video-wrappers/youtube.js",
},
},
washingtonpost: {
videoWrapperScriptPath: "video-wrappers/washingtonpost.js",
},
},
};
}