Loading browser/extensions/pictureinpicture/data/picture_in_picture_overrides.js +6 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,12 @@ let AVAILABLE_PIP_OVERRIDES; }, }, funimation: { "https://*.funimation.com/*": { videoWrapperScriptPath: "video-wrappers/funimation.js", }, }, instagram: { "https://www.instagram.com/*": { policy: TOGGLE_POLICIES.ONE_QUARTER }, }, Loading browser/extensions/pictureinpicture/moz.build +1 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ FINAL_TARGET_FILES.features["pictureinpicture@mozilla.org"]["lib"] += [ ] FINAL_TARGET_FILES.features["pictureinpicture@mozilla.org"]["video-wrappers"] += [ "video-wrappers/funimation.js", "video-wrappers/mock-wrapper.js", "video-wrappers/netflix.js", "video-wrappers/primeVideo.js", Loading browser/extensions/pictureinpicture/video-wrappers/funimation.js 0 → 100644 +41 −0 Original line number Diff line number Diff line /* 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"; class PictureInPictureVideoWrapper { setCaptionContainerObserver(video, updateCaptionsFunction) { let container = document.getElementById("vjs_video_3"); if (container) { updateCaptionsFunction(""); const callback = function(mutationsList, observer) { let textNodeList = container .querySelector(".vjs-text-track-cue") ?.querySelectorAll("div"); if (!textNodeList) { updateCaptionsFunction(""); return; } updateCaptionsFunction( Array.from(textNodeList, x => x.textContent).join("\n") ); }; // immediately invoke the callback function to add subtitles to the PiP window callback([1], null); let captionsObserver = new MutationObserver(callback); captionsObserver.observe(container, { attributes: false, childList: true, subtree: true, }); } } } this.PictureInPictureVideoWrapper = PictureInPictureVideoWrapper; Loading
browser/extensions/pictureinpicture/data/picture_in_picture_overrides.js +6 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,12 @@ let AVAILABLE_PIP_OVERRIDES; }, }, funimation: { "https://*.funimation.com/*": { videoWrapperScriptPath: "video-wrappers/funimation.js", }, }, instagram: { "https://www.instagram.com/*": { policy: TOGGLE_POLICIES.ONE_QUARTER }, }, Loading
browser/extensions/pictureinpicture/moz.build +1 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ FINAL_TARGET_FILES.features["pictureinpicture@mozilla.org"]["lib"] += [ ] FINAL_TARGET_FILES.features["pictureinpicture@mozilla.org"]["video-wrappers"] += [ "video-wrappers/funimation.js", "video-wrappers/mock-wrapper.js", "video-wrappers/netflix.js", "video-wrappers/primeVideo.js", Loading
browser/extensions/pictureinpicture/video-wrappers/funimation.js 0 → 100644 +41 −0 Original line number Diff line number Diff line /* 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"; class PictureInPictureVideoWrapper { setCaptionContainerObserver(video, updateCaptionsFunction) { let container = document.getElementById("vjs_video_3"); if (container) { updateCaptionsFunction(""); const callback = function(mutationsList, observer) { let textNodeList = container .querySelector(".vjs-text-track-cue") ?.querySelectorAll("div"); if (!textNodeList) { updateCaptionsFunction(""); return; } updateCaptionsFunction( Array.from(textNodeList, x => x.textContent).join("\n") ); }; // immediately invoke the callback function to add subtitles to the PiP window callback([1], null); let captionsObserver = new MutationObserver(callback); captionsObserver.observe(container, { attributes: false, childList: true, subtree: true, }); } } } this.PictureInPictureVideoWrapper = PictureInPictureVideoWrapper;