Skip to content

Commit

Permalink
there area multiple adtime texts, the dv-player-fullscreen is the cor…
Browse files Browse the repository at this point in the history
…rect one
  • Loading branch information
Dreamlinerm committed Oct 27, 2024
1 parent 0057ad4 commit eeb0fc1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions firefox/skipper.js
Original file line number Diff line number Diff line change
Expand Up @@ -1096,15 +1096,16 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO
}
async function skipAd(video) {
// Series grimm
const adTimeText = document.querySelector(".atvwebplayersdk-ad-timer-text");
// there area multiple adtime texts, the dv-player-fullscreen is the correct one
const adTimeText = document.querySelector(".dv-player-fullscreen .atvwebplayersdk-ad-timer-text");
if (adTimeText?.checkVisibility()) {
let adTime;
adTime = parseAdTime(adTimeText?.childNodes?.[0]?.textContent);
if (!adTime) adTime = parseAdTime(adTimeText?.childNodes?.[1]?.textContent);
// !document.querySelector(".fu4rd6c.f1cw2swo") so it doesn't try to skip when the self ad is playing
if (!document.querySelector(".fu4rd6c.f1cw2swo") && adTime > 1 && !lastAdTimeText) {
lastAdTimeText = adTime;
resetLastATimeText();
resetLastATimeText(3000);
// biggest skiptime before crashing on amazon.com, can be little higher than 90 but 90 to be safe
const bigTime = 90;
const skipTime = adTime > bigTime ? bigTime : adTime - 1;
Expand Down

0 comments on commit eeb0fc1

Please sign in to comment.