Skip to content

Commit

Permalink
better amazon dblclick
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamlinerm committed Aug 31, 2024
1 parent 05e293b commit e577651
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions firefox/skipper.js
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,6 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO
if (settings.Amazon?.speedSlider) Amazon_SpeedSlider(video);
if (settings.Amazon?.subtitle) Amazon_Subtitles();
if (settings.Amazon?.xray) Amazon_xray();
if (settings?.Video?.doubleClick) Amazon_closeFullscreenButtons();
}
const AmazonSkipIntroConfig = { attributes: true, attributeFilter: [".skipelement"], subtree: true, childList: true, attributeOldValue: false };
// const AmazonSkipIntro = new RegExp("skipelement", "i");
Expand Down Expand Up @@ -1125,33 +1124,12 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO
if (settings.Video?.doubleClick) {
// event listener for double click
document.ondblclick = function () {
let video = document.querySelector(AmazonVideoClass);
let webPlayer = document.querySelector(".dv-player-fullscreen");
if (webPlayer && video?.checkVisibility()) {
// video is fullscreen
if (document.fullscreenElement) {
document.exitFullscreen();
} else {
webPlayer.requestFullscreen();
}
}
document.querySelector(".dv-player-fullscreen button[class*=fullscreen-button]")?.click();
};
} else {
document.ondblclick = null;
}
}
async function Amazon_closeFullscreenButtons() {
document.querySelector(".dv-player-fullscreen button[class*=playerclose-button]").onclick = function () {
if (document.fullscreenElement) {
document.exitFullscreen();
}
};
document.querySelector(".dv-player-fullscreen button[class*=fullscreen-button]").onclick = function () {
if (document.fullscreenElement) {
document.exitFullscreen();
}
};
}
// #endregion
// #region Crunchyroll
// Crunchyroll functions
Expand Down

0 comments on commit e577651

Please sign in to comment.