Skip to content

Commit

Permalink
better layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamlinerm committed Sep 10, 2023
1 parent 2dc126b commit f911cb3
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 29 deletions.
26 changes: 12 additions & 14 deletions chrome/skipper.js
Original file line number Diff line number Diff line change
Expand Up @@ -639,20 +639,18 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar) {
const adTime = parseInt(adTimeText.textContent.match(/\d+/)[0]);
// adTimeText.textContent.length > 7 so it doesn't try to skip when the self ad is playing
// !document.querySelector(".fu4rd6c.f1cw2swo") so it doesn't try to skip when the self ad is playing
if (!document.querySelector(".fu4rd6c.f1cw2swo")) {
if (adTime > (lastAdTimeText || 0)) {
if (typeof adTime === "number" && adTime > 1) {
lastAdTimeText = adTime;
resetLastATimeText();
// getting stuck loading when skipping ad longer than 100 seconds i think
// let skipTime = adTime <= 20 ? adTime - 1 : 20;
let skipTime = adTime - 1;
video.currentTime += skipTime;
log("FreeVee Ad skipped, length:", skipTime, "s");
settings.Statistics.AmazonAdTimeSkipped += skipTime;
increaseBadge();
// video.removeEventListener("playing", skipAd);
}
if (!document.querySelector(".fu4rd6c.f1cw2swo") && !lastAdTimeText) {
if (typeof adTime === "number" && adTime > 1) {
lastAdTimeText = adTime;
resetLastATimeText();
// getting stuck loading when skipping ad longer than 100 seconds i think
// let skipTime = adTime <= 20 ? adTime - 1 : 20;
let skipTime = adTime - 1;
video.currentTime += skipTime;
log("FreeVee Ad skipped, length:", skipTime, "s");
settings.Statistics.AmazonAdTimeSkipped += skipTime;
increaseBadge();
// video.removeEventListener("playing", skipAd);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion firefox/popup/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ <h2 i18n>ImportSettings</h2>
<h2>Changelog</h2>
<div>
<div class="line flex">
<h2>1.0.58</h2>
<h2>1.0.56,57</h2>
<ul>
<li>Improved Freevee Ad skip</li>
</ul>
Expand Down
26 changes: 12 additions & 14 deletions firefox/skipper.js
Original file line number Diff line number Diff line change
Expand Up @@ -639,20 +639,18 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar) {
const adTime = parseInt(adTimeText.textContent.match(/\d+/)[0]);
// adTimeText.textContent.length > 7 so it doesn't try to skip when the self ad is playing
// !document.querySelector(".fu4rd6c.f1cw2swo") so it doesn't try to skip when the self ad is playing
if (!document.querySelector(".fu4rd6c.f1cw2swo")) {
if (adTime > (lastAdTimeText || 0)) {
if (typeof adTime === "number" && adTime > 1) {
lastAdTimeText = adTime;
resetLastATimeText();
// getting stuck loading when skipping ad longer than 100 seconds i think
// let skipTime = adTime <= 20 ? adTime - 1 : 20;
let skipTime = adTime - 1;
video.currentTime += skipTime;
log("FreeVee Ad skipped, length:", skipTime, "s");
settings.Statistics.AmazonAdTimeSkipped += skipTime;
increaseBadge();
// video.removeEventListener("playing", skipAd);
}
if (!document.querySelector(".fu4rd6c.f1cw2swo") && !lastAdTimeText) {
if (typeof adTime === "number" && adTime > 1) {
lastAdTimeText = adTime;
resetLastATimeText();
// getting stuck loading when skipping ad longer than 100 seconds i think
// let skipTime = adTime <= 20 ? adTime - 1 : 20;
let skipTime = adTime - 1;
video.currentTime += skipTime;
log("FreeVee Ad skipped, length:", skipTime, "s");
settings.Statistics.AmazonAdTimeSkipped += skipTime;
increaseBadge();
// video.removeEventListener("playing", skipAd);
}
}
}
Expand Down

0 comments on commit f911cb3

Please sign in to comment.