diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
commit | 2aa4a82499d4becd2284cdb482213d541b8804dd (patch) | |
tree | b80bf8bf13c3766139fbacc530efd0dd9d54394c /browser/extensions/webcompat/data/picture_in_picture_overrides.js | |
parent | Initial commit. (diff) | |
download | firefox-upstream.tar.xz firefox-upstream.zip |
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/extensions/webcompat/data/picture_in_picture_overrides.js')
-rw-r--r-- | browser/extensions/webcompat/data/picture_in_picture_overrides.js | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/browser/extensions/webcompat/data/picture_in_picture_overrides.js b/browser/extensions/webcompat/data/picture_in_picture_overrides.js new file mode 100644 index 0000000000..e9a4e88657 --- /dev/null +++ b/browser/extensions/webcompat/data/picture_in_picture_overrides.js @@ -0,0 +1,60 @@ +/* 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.jsm 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 + // https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Match_patterns + // + // Example: + // + // "https://*.youtube.com/*": { + // policy: TOGGLE_POLICIES.THREE_QUARTERS, + // keyboardControls: KEYBOARD_CONTROLS.PLAY_PAUSE | KEYBOARD_CONTROLS.VOLUME, + // }, + // "https://*.twitch.tv/mikeconley_dot_ca/*": { + // policy: TOGGLE_POLICIES.TOP, + // keyboardControls: KEYBOARD_CONTROLS.NONE, + // }, + + instagram: { + "https://www.instagram.com/*": { policy: TOGGLE_POLICIES.ONE_QUARTER }, + }, + + laracasts: { + "https://*.laracasts.com/*": { policy: TOGGLE_POLICIES.ONE_QUARTER }, + }, + + netflix: { + "https://*.netflix.com/*": { keyboardControls: ~KEYBOARD_CONTROLS.SEEK }, + "https://*.netflix.com/browse": { policy: TOGGLE_POLICIES.HIDDEN }, + "https://*.netflix.com/latest": { policy: TOGGLE_POLICIES.HIDDEN }, + }, + + twitch: { + "https://*.twitch.tv/*": { policy: TOGGLE_POLICIES.ONE_QUARTER }, + "https://*.twitch.tech/*": { policy: TOGGLE_POLICIES.ONE_QUARTER }, + "https://*.twitch.a2z.com/*": { policy: TOGGLE_POLICIES.ONE_QUARTER }, + }, + + udemy: { + "https://*.udemy.com/*": { policy: TOGGLE_POLICIES.ONE_QUARTER }, + }, + + youtube: { + "https://*.youtube.com/*": { visibilityThreshold: 0.9 }, + }, + }; +} |