зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1864896: Autofix unused function arguments (pip). r=pip-reviewers,kpatenio
Differential Revision: https://phabricator.services.mozilla.com/D202977
This commit is contained in:
Родитель
d92190fa91
Коммит
59b829116d
|
@ -25,7 +25,7 @@ this.pictureInPictureParent = class extends ExtensionAPI {
|
|||
* @param {ExtensionContext} context the context of our extension
|
||||
* @returns {object} returns the necessary API structure required to manage sharedData in PictureInPictureParent
|
||||
*/
|
||||
getAPI(context) {
|
||||
getAPI() {
|
||||
return {
|
||||
pictureInPictureParent: {
|
||||
setOverrides(overrides) {
|
||||
|
|
|
@ -35,7 +35,7 @@ class PictureInPictureVideoWrapper {
|
|||
|
||||
if (container) {
|
||||
updateCaptionsFunction("");
|
||||
const callback = function (mutationsList, observer) {
|
||||
const callback = function () {
|
||||
let text = container?.querySelector("#overlayCaption").innerText;
|
||||
|
||||
if (!text) {
|
||||
|
|
|
@ -10,7 +10,7 @@ class PictureInPictureVideoWrapper {
|
|||
|
||||
if (container) {
|
||||
updateCaptionsFunction("");
|
||||
const callback = function (mutationsList, observer) {
|
||||
const callback = function () {
|
||||
let textNodeList = container.querySelectorAll(".avp-captions-line");
|
||||
if (!textNodeList.length) {
|
||||
updateCaptionsFunction("");
|
||||
|
|
|
@ -10,7 +10,7 @@ class PictureInPictureVideoWrapper {
|
|||
|
||||
if (container) {
|
||||
updateCaptionsFunction("");
|
||||
const callback = function (mutationsList, observer) {
|
||||
const callback = function () {
|
||||
let text = container.querySelector(".p_cueDirUniWrapper")?.innerText;
|
||||
updateCaptionsFunction(text);
|
||||
};
|
||||
|
|
|
@ -10,7 +10,7 @@ class PictureInPictureVideoWrapper {
|
|||
|
||||
if (container) {
|
||||
updateCaptionsFunction("");
|
||||
const callback = function (mutationsList, observer) {
|
||||
const callback = function () {
|
||||
let textNodeList = container
|
||||
?.querySelector(".subtitles")
|
||||
?.querySelectorAll("div");
|
||||
|
|
|
@ -41,7 +41,7 @@ class PictureInPictureVideoWrapper {
|
|||
container = document.querySelector(".shaka-text-container");
|
||||
if (container) {
|
||||
updateCaptionsFunction("");
|
||||
const callback = function (mutationsList, observer) {
|
||||
const callback = function () {
|
||||
let textNodeList = container?.querySelectorAll("span");
|
||||
if (!textNodeList) {
|
||||
updateCaptionsFunction("");
|
||||
|
|
|
@ -10,7 +10,7 @@ class PictureInPictureVideoWrapper {
|
|||
|
||||
if (container) {
|
||||
updateCaptionsFunction("");
|
||||
const callback = function (mutationsList, observer) {
|
||||
const callback = function () {
|
||||
let text = container.querySelector(
|
||||
".closed-captions.is-visible"
|
||||
)?.innerText;
|
||||
|
|
|
@ -25,7 +25,7 @@ class PictureInPictureVideoWrapper {
|
|||
|
||||
if (container) {
|
||||
updateCaptionsFunction("");
|
||||
const callback = function (mutationsList, observer) {
|
||||
const callback = function () {
|
||||
let text = container.querySelector(
|
||||
'[data-testid="CueBoxContainer"]'
|
||||
)?.innerText;
|
||||
|
|
|
@ -10,7 +10,7 @@ class PictureInPictureVideoWrapper {
|
|||
|
||||
if (container) {
|
||||
updateCaptionsFunction("");
|
||||
const callback = function (mutationsList, observer) {
|
||||
const callback = function () {
|
||||
let textNodeList = container?.querySelectorAll("span");
|
||||
if (!textNodeList) {
|
||||
updateCaptionsFunction("");
|
||||
|
|
|
@ -32,7 +32,7 @@ class PictureInPictureVideoWrapper {
|
|||
|
||||
if (container) {
|
||||
updateCaptionsFunction("");
|
||||
const callback = function (mutationsList, observer) {
|
||||
const callback = function () {
|
||||
// This will get the subtitles for both live and regular playback videos
|
||||
// and combine them to display. liveVideoText should be an empty string
|
||||
// when the video is regular playback and vice versa. If both
|
||||
|
@ -63,7 +63,7 @@ class PictureInPictureVideoWrapper {
|
|||
});
|
||||
}
|
||||
}
|
||||
getDuration(video) {
|
||||
getDuration() {
|
||||
return this.player.duration;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,12 +5,12 @@
|
|||
"use strict";
|
||||
|
||||
class PictureInPictureVideoWrapper {
|
||||
play(video) {
|
||||
play() {
|
||||
let playPauseButton = document.querySelector("#player .play-pause-button");
|
||||
playPauseButton.click();
|
||||
}
|
||||
|
||||
pause(video) {
|
||||
pause() {
|
||||
let invalidSelector = "#player .pause-button";
|
||||
let playPauseButton = document.querySelector(invalidSelector);
|
||||
playPauseButton.click();
|
||||
|
|
|
@ -25,7 +25,7 @@ class PictureInPictureVideoWrapper {
|
|||
* @param {HTMLVideoElement} video The original video element
|
||||
* @returns {number} The current time in seconds
|
||||
*/
|
||||
getCurrentTime(video) {
|
||||
getCurrentTime() {
|
||||
return this.player.getCurrentTime() / 1000;
|
||||
}
|
||||
/**
|
||||
|
@ -35,7 +35,7 @@ class PictureInPictureVideoWrapper {
|
|||
* @param {HTMLVideoElement} video The original video element
|
||||
* @returns {number} The duration in seconds
|
||||
*/
|
||||
getDuration(video) {
|
||||
getDuration() {
|
||||
return this.player.getDuration() / 1000;
|
||||
}
|
||||
play() {
|
||||
|
@ -50,7 +50,7 @@ class PictureInPictureVideoWrapper {
|
|||
|
||||
if (container) {
|
||||
updateCaptionsFunction("");
|
||||
const callback = function (mutationsList, observer) {
|
||||
const callback = function () {
|
||||
let text = container.querySelector(".player-timedtext").innerText;
|
||||
updateCaptionsFunction(text);
|
||||
};
|
||||
|
|
|
@ -10,7 +10,7 @@ class PictureInPictureVideoWrapper {
|
|||
|
||||
if (container) {
|
||||
updateCaptionsFunction("");
|
||||
const callback = function (mutationsList, observer) {
|
||||
const callback = function () {
|
||||
let text = container.querySelector(".cueWrap-2P4Ue4VQ")?.innerText;
|
||||
if (!text) {
|
||||
updateCaptionsFunction("");
|
||||
|
|
|
@ -10,7 +10,7 @@ class PictureInPictureVideoWrapper {
|
|||
|
||||
if (container) {
|
||||
updateCaptionsFunction("");
|
||||
const callback = function (mutationsList, observer) {
|
||||
const callback = function () {
|
||||
let textNodeList = container
|
||||
.querySelector(".shaka-text-wrapper")
|
||||
?.querySelectorAll('span[style="background-color: black;"]');
|
||||
|
|
|
@ -57,7 +57,7 @@ class PictureInPictureVideoWrapper {
|
|||
|
||||
if (container) {
|
||||
updateCaptionsFunction("");
|
||||
const callback = function (mutationsList, observer) {
|
||||
const callback = function (mutationsList) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
for (const mutation of mutationsList) {
|
||||
let text;
|
||||
|
|
|
@ -10,7 +10,7 @@ class PictureInPictureVideoWrapper {
|
|||
|
||||
if (container) {
|
||||
updateCaptionsFunction("");
|
||||
const callback = function (mutationsList, observer) {
|
||||
const callback = function () {
|
||||
let text = container.querySelector(
|
||||
`.text-track-wrapper:not([style*="display: none"])`
|
||||
)?.innerText;
|
||||
|
|
|
@ -10,7 +10,7 @@ class PictureInPictureVideoWrapper {
|
|||
|
||||
if (container) {
|
||||
updateCaptionsFunction("");
|
||||
const callback = function (mutationsList, observer) {
|
||||
const callback = function () {
|
||||
let text = container?.querySelector(
|
||||
`[data-id="captionsComponent"]:not([style="display: none;"])`
|
||||
)?.innerText;
|
||||
|
|
|
@ -10,7 +10,7 @@ class PictureInPictureVideoWrapper {
|
|||
|
||||
if (container) {
|
||||
updateCaptionsFunction("");
|
||||
const callback = function (mutationsList, observer) {
|
||||
const callback = function () {
|
||||
let text =
|
||||
container.querySelector(`.tubi-text-track-container`)?.innerText ||
|
||||
container.querySelector(`.subtitleWindow`)?.innerText;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
"use strict";
|
||||
|
||||
class PictureInPictureVideoWrapper {
|
||||
isLive(video) {
|
||||
isLive() {
|
||||
return !document.querySelector(".seekbar-bar");
|
||||
}
|
||||
getDuration(video) {
|
||||
|
|
|
@ -37,7 +37,7 @@ class PictureInPictureVideoWrapper {
|
|||
|
||||
if (container) {
|
||||
updateCaptionsFunction("");
|
||||
const callback = function (mutationsList, observer) {
|
||||
const callback = function () {
|
||||
let text = container.querySelector(
|
||||
`[data-purpose="captions-cue-text"]`
|
||||
)?.innerText;
|
||||
|
|
|
@ -11,7 +11,7 @@ class PictureInPictureVideoWrapper {
|
|||
|
||||
if (container) {
|
||||
updateCaptionsFunction("");
|
||||
const callback = function (mutationsList, observer) {
|
||||
const callback = function () {
|
||||
let text = container.querySelector("div").innerText;
|
||||
if (!text) {
|
||||
updateCaptionsFunction("");
|
||||
|
|
|
@ -10,7 +10,7 @@ class PictureInPictureVideoWrapper {
|
|||
|
||||
if (container) {
|
||||
updateCaptionsFunction("");
|
||||
const callback = function (mutationsList, observer) {
|
||||
const callback = function () {
|
||||
let text = container.querySelector(".playkit-subtitles").innerText;
|
||||
if (!text) {
|
||||
updateCaptionsFunction("");
|
||||
|
|
|
@ -10,7 +10,7 @@ class PictureInPictureVideoWrapper {
|
|||
|
||||
if (container) {
|
||||
updateCaptionsFunction("");
|
||||
const callback = function (mutationsList, observer) {
|
||||
const callback = function () {
|
||||
let subtitleElement = container.querySelector(".powa-sub-torpedo");
|
||||
if (!subtitleElement?.innerText) {
|
||||
updateCaptionsFunction("");
|
||||
|
|
|
@ -10,7 +10,7 @@ class PictureInPictureVideoWrapper {
|
|||
|
||||
if (container) {
|
||||
updateCaptionsFunction("");
|
||||
const callback = function (mutationsList, observer) {
|
||||
const callback = function () {
|
||||
let text = container.querySelector(".vp-cc-element.vp-show")?.innerText;
|
||||
|
||||
if (!text) {
|
||||
|
|
|
@ -14,7 +14,7 @@ class PictureInPictureVideoWrapper {
|
|||
? shortsPlayer
|
||||
: video.closest("#movie_player")?.wrappedJSObject;
|
||||
}
|
||||
isLive(video) {
|
||||
isLive() {
|
||||
return !!document.querySelector(".ytp-live");
|
||||
}
|
||||
setMuted(video, shouldMute) {
|
||||
|
@ -39,7 +39,7 @@ class PictureInPictureVideoWrapper {
|
|||
|
||||
if (container) {
|
||||
updateCaptionsFunction("");
|
||||
const callback = function (mutationsList, observer) {
|
||||
const callback = function (mutationsList) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
for (const mutation of mutationsList) {
|
||||
let textNodeList = container
|
||||
|
|
|
@ -247,10 +247,10 @@ let Player = {
|
|||
this.audioScrubbing = true;
|
||||
this.handleAudioScrubbing(event.target.value);
|
||||
});
|
||||
this.audioScrubber.addEventListener("change", event => {
|
||||
this.audioScrubber.addEventListener("change", () => {
|
||||
this.audioScrubbing = false;
|
||||
});
|
||||
this.audioScrubber.addEventListener("pointerdown", event => {
|
||||
this.audioScrubber.addEventListener("pointerdown", () => {
|
||||
if (this.isMuted) {
|
||||
this.audioScrubber.max = 1;
|
||||
}
|
||||
|
@ -1140,7 +1140,7 @@ let Player = {
|
|||
* @param {Event} event
|
||||
* Event context data object
|
||||
*/
|
||||
onResize(event) {
|
||||
onResize() {
|
||||
this.toggleSubtitlesSettingsPanel({ forceHide: true });
|
||||
this.resizeDebouncer.disarm();
|
||||
this.resizeDebouncer.arm();
|
||||
|
@ -1152,7 +1152,7 @@ let Player = {
|
|||
* @param {Event} event
|
||||
* Event context data object
|
||||
*/
|
||||
onCommand(event) {
|
||||
onCommand() {
|
||||
this.closePipWindow({ reason: "shortcut" });
|
||||
},
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ add_task(async () => {
|
|||
// if we receive the PictureInPicture:Request message.
|
||||
const MESSAGE = "PictureInPicture:Request";
|
||||
let sawMessage = false;
|
||||
let listener = msg => {
|
||||
let listener = () => {
|
||||
sawMessage = true;
|
||||
};
|
||||
browser.messageManager.addMessageListener(MESSAGE, listener);
|
||||
|
|
|
@ -65,7 +65,7 @@ add_task(async function test_close_pagehide() {
|
|||
ok(pipWin, "Got Picture-in-Picture window.");
|
||||
|
||||
let pipClosed = BrowserTestUtils.domWindowClosed(pipWin);
|
||||
await SpecialPowers.spawn(browser, [{ videoID }], async args => {
|
||||
await SpecialPowers.spawn(browser, [{ videoID }], async () => {
|
||||
content.location.href = "otherpage.html";
|
||||
});
|
||||
|
||||
|
@ -92,7 +92,7 @@ add_task(async function test_open_pip_window_history_nav() {
|
|||
let pipWin = await triggerPictureInPicture(browser, videoID);
|
||||
ok(pipWin, "Got Picture-in-Picture window.");
|
||||
|
||||
await SpecialPowers.spawn(browser, [{ videoID }], async args => {
|
||||
await SpecialPowers.spawn(browser, [{ videoID }], async () => {
|
||||
let popStatePromise = ContentTaskUtils.waitForEvent(
|
||||
content,
|
||||
"popstate"
|
||||
|
|
|
@ -12,8 +12,8 @@ var EventUtils = {};
|
|||
Services.scriptloader.loadSubScript(EVENTUTILS_URL, EventUtils);
|
||||
|
||||
async function detachTab(tab) {
|
||||
let newWindowPromise = new Promise((resolve, reject) => {
|
||||
let observe = (win, topic, data) => {
|
||||
let newWindowPromise = new Promise(resolve => {
|
||||
let observe = win => {
|
||||
Services.obs.removeObserver(observe, "domwindowopened");
|
||||
resolve(win);
|
||||
};
|
||||
|
|
|
@ -28,7 +28,7 @@ add_task(async () => {
|
|||
let otherVideo = doc.querySelector(`video:not([id="${videoID}"])`);
|
||||
let eventFired = false;
|
||||
|
||||
let listener = e => {
|
||||
let listener = () => {
|
||||
eventFired = true;
|
||||
};
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ add_task(async () => {
|
|||
|
||||
// Remove other page elements before reading PiP toggle's client rect.
|
||||
// Otherwise, we will provide the wrong coordinates when simulating the touch event.
|
||||
await SpecialPowers.spawn(browser, [], async args => {
|
||||
await SpecialPowers.spawn(browser, [], async () => {
|
||||
info(
|
||||
"Removing other elements first to make the PiP toggle more visible"
|
||||
);
|
||||
|
|
Загрузка…
Ссылка в новой задаче