Skip to content

Commit

Permalink
chrome build
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamlinerm committed Oct 9, 2024
1 parent 1a2f885 commit 29d2b25
Show file tree
Hide file tree
Showing 19 changed files with 119 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ If there is no score they are refreshed once per day. If the movie is newer than
| Intro | ✅ <a href="https://www.netflix.com/watch/80011385">brooklyn nine nine S1E4</a>| ✅ <a href="https://www.amazon.de/gp/video/detail/B07FMF18GN">lucifer S3E4</a>| ✅ <a href="https://www.disneyplus.com/en-gb/video/4e9305a0-6ade-4922-bfba-c68c53a0d5a6">star wars andor S1E2</a> |[One piece](https://www.crunchyroll.com/series/GRMG8ZQZR/one-piece) ||
| Recaps | ✅ <a href="https://www.netflix.com/watch/81274622">Outer Banks S2E1</a>| ✅ <a href="https://www.amazon.de/gp/video/detail/B07FMF18GN">lucifer S3E3</a> | ✅ <a href="https://www.disneyplus.com/en-gb/video/efe020f1-7a23-42b5-a330-b193eef8531b">Criminal Minds S1E2</a>| ? ||
| Credits |||| ❌(not necessary if outro is skipped) ||
| Ads ||[2 Broke Girls](https://www.amazon.de/gp/video/detail/B01D0H8CAY/ref=atv_hm_fre_c_zwoINQ_2_2?jic=36%7CCgtmcmVld2l0aGFkcxIMc3Vic2NyaXB0aW9u) || ❌(Ublock can do it) | ? |
| Ads |||| ❌(Ublock can do it) | ? |
| Add Speed Slider ||||||
| Play on Fullscreen ||||||
| fullscreen on double click ||||| ? |
Expand Down
3 changes: 3 additions & 0 deletions chrome/_locales/de/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -302,5 +302,8 @@
},
"scrollVolumeDescription": {
"message": "Wenn Sie auf dem Tonsymbol nach oben oder unten scrollen, wird die Lautstärke geändert."
},
"DisneyAdDescription": {
"message": "Zeit der übersprungenen Disney-Werbung."
}
}
3 changes: 3 additions & 0 deletions chrome/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -302,5 +302,8 @@
},
"scrollVolumeDescription": {
"message": "Scrolling up or down on the Sound Icon will change the volume."
},
"DisneyAdDescription": {
"message": "Time of skipped Disney Ads."
}
}
3 changes: 3 additions & 0 deletions chrome/_locales/es/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -302,5 +302,8 @@
},
"scrollVolumeDescription": {
"message": "Si se desplaza hacia arriba o hacia abajo en el icono de sonido, cambiará el volumen."
},
"DisneyAdDescription": {
"message": "Tiempo de anuncios Disney saltados."
}
}
3 changes: 3 additions & 0 deletions chrome/_locales/fr/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -302,5 +302,8 @@
},
"scrollVolumeDescription": {
"message": "Le défilement vers le haut ou vers le bas de l'icône du son modifie le volume."
},
"DisneyAdDescription": {
"message": "Durée des publicités Disney sautées."
}
}
3 changes: 3 additions & 0 deletions chrome/_locales/it/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -302,5 +302,8 @@
},
"scrollVolumeDescription": {
"message": "Lo scorrimento verso l'alto o verso il basso dell'icona del suono modifica il volume."
},
"DisneyAdDescription": {
"message": "Tempo di salto degli annunci Disney."
}
}
3 changes: 3 additions & 0 deletions chrome/_locales/ja/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -302,5 +302,8 @@
},
"scrollVolumeDescription": {
"message": "サウンドアイコンを上下にスクロールすると音量が変わります。"
},
"DisneyAdDescription": {
"message": "ディズニーの広告をスキップした時間。"
}
}
3 changes: 3 additions & 0 deletions chrome/_locales/ko/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -302,5 +302,8 @@
},
"scrollVolumeDescription": {
"message": "사운드 아이콘을 위아래로 스크롤하면 볼륨이 변경됩니다."
},
"DisneyAdDescription": {
"message": "디즈니 광고를 건너뛴 시간."
}
}
3 changes: 3 additions & 0 deletions chrome/_locales/pl/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -302,5 +302,8 @@
},
"scrollVolumeDescription": {
"message": "Przewijanie ikony dźwięku w górę lub w dół powoduje zmianę głośności."
},
"DisneyAdDescription": {
"message": "Czas pominiętych reklam Disneya."
}
}
3 changes: 3 additions & 0 deletions chrome/_locales/pt/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -302,5 +302,8 @@
},
"scrollVolumeDescription": {
"message": "Deslocar-se para cima ou para baixo no ícone de som altera o volume."
},
"DisneyAdDescription": {
"message": "Tempo de saltar anúncios da Disney."
}
}
3 changes: 3 additions & 0 deletions chrome/_locales/pt_BR/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -302,5 +302,8 @@
},
"scrollVolumeDescription": {
"message": "Deslocar-se para cima ou para baixo no ícone de som altera o volume."
},
"DisneyAdDescription": {
"message": "Tempo de saltar anúncios da Disney."
}
}
3 changes: 3 additions & 0 deletions chrome/_locales/sv/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -302,5 +302,8 @@
},
"scrollVolumeDescription": {
"message": "Om du bläddrar upp eller ner på ljudikonen ändras volymen."
},
"DisneyAdDescription": {
"message": "Tid för överhoppade Disney-annonser."
}
}
3 changes: 3 additions & 0 deletions chrome/_locales/tr/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -302,5 +302,8 @@
},
"scrollVolumeDescription": {
"message": "Ses Simgesi üzerinde yukarı veya aşağı kaydırma yapmak ses seviyesini değiştirecektir."
},
"DisneyAdDescription": {
"message": "Disney reklamlarını atlama zamanı."
}
}
3 changes: 3 additions & 0 deletions chrome/_locales/zh_CN/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -302,5 +302,8 @@
},
"scrollVolumeDescription": {
"message": "上下滚动声音图标可改变音量。"
},
"DisneyAdDescription": {
"message": "跳过迪斯尼广告的时间"
}
}
11 changes: 9 additions & 2 deletions chrome/cr.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const defaultSettings = {
profile: true,
showRating: true,
},
Disney: { skipIntro: true, skipCredits: true, watchCredits: false, speedSlider: true, showRating: true, selfAd: true },
Disney: { skipIntro: true, skipCredits: true, watchCredits: false, skipAd: true, speedSlider: true, showRating: true, selfAd: true },
Crunchyroll: {
skipIntro: true,
speedSlider: true,
Expand All @@ -48,7 +48,14 @@ const defaultSettings = {
},
HBO: { skipIntro: true, skipCredits: true, watchCredits: false, speedSlider: true, showRating: true },
Video: { playOnFullScreen: true, epilepsy: false, userAgent: true, doubleClick: true, scrollVolume: true },
Statistics: { AmazonAdTimeSkipped: 0, NetflixAdTimeSkipped: 0, IntroTimeSkipped: 0, RecapTimeSkipped: 0, SegmentsSkipped: 0 },
Statistics: {
AmazonAdTimeSkipped: 0,
NetflixAdTimeSkipped: 0,
DisneyAdTimeSkipped: 0,
IntroTimeSkipped: 0,
RecapTimeSkipped: 0,
SegmentsSkipped: 0,
},
General: {
Crunchyroll_profilePicture: null,
profileName: null,
Expand Down
7 changes: 5 additions & 2 deletions chrome/popup/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ <h2 class="title" data-i18n>pageTitle</h2>
<a target="_blank" class="flex-center flex-col" style="text-align: center; text-decoration: none"
href="https://chrome.google.com/webstore/detail/netflixprime-auto-skip/akaimhgappllmlkadblbdknhbfghdgle">
<p style="font-size: 1em" data-i18n>rateNow</p>
<img src="https://img.shields.io/chrome-web-store/stars/akaimhgappllmlkadblbdknhbfghdgle?color=e60010"
alt="rating">
<img src="https://img.shields.io/chrome-web-store/stars/akaimhgappllmlkadblbdknhbfghdgle?color=e60010" alt="rating">
</a>
<div class="flex flex-row">
<a class="flex flex-center" style="font-size: 1.5em;"
Expand Down Expand Up @@ -419,6 +418,10 @@ <h2 data-i18n>SkippedTime</h2>
<p data-i18n>StatisticAd;Netflix</p>
<p id="StatisticsNetflixAdTimeSkipped">0s</p>
</div>
<div class="line flex flex-between">
<p data-i18n>StatisticAd;Disney</p>
<p id="StatisticsDisneyAdTimeSkipped">0s</p>
</div>
<div class="line flex flex-between">
<p data-i18n>StatisticIntro</p>
<p id="StatisticsIntroTimeSkipped">0s</p>
Expand Down
22 changes: 19 additions & 3 deletions chrome/popup/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ <h2 class="title" data-i18n>pageTitle</h2>
<a target="_blank" class="flex-center flex-col" style="text-align: center; text-decoration: none"
href="https://chrome.google.com/webstore/detail/netflixprime-auto-skip/akaimhgappllmlkadblbdknhbfghdgle">
<p style="font-size: 1em" data-i18n>rateNow</p>
<img src="https://img.shields.io/chrome-web-store/stars/akaimhgappllmlkadblbdknhbfghdgle?color=e60010"
alt="rating">
<img src="https://img.shields.io/chrome-web-store/stars/akaimhgappllmlkadblbdknhbfghdgle?color=e60010" alt="rating">
</a>
</div>
<div class="flex flex-col MenuButtons" style="flex-wrap: wrap">
Expand Down Expand Up @@ -341,7 +340,12 @@ <h2 data-i18n>SharedPageTitle</h2>
<span class="slider round"></span>
</label>
</td>
<td></td>
<td>
<label class="switch">
<input type="checkbox" id="DisneySkipAd">
<span class="slider round"></span>
</label>
</td>
<td></td>
<td></td>
</tr>
Expand Down Expand Up @@ -690,6 +694,12 @@ <h2 data-i18n>SkippedTime</h2>
</div>
<p class="description" data-i18n>NetflixAdDescription</p>
<hr>
<div class="line flex flex-between">
<p data-i18n>StatisticAd;Disney</p>
<p id="StatisticsDisneyAdTimeSkipped">0s</p>
</div>
<p class="description" data-i18n>DisneyAdDescription</p>
<hr>
<div class="line flex flex-between">
<p data-i18n>StatisticIntro</p>
<p id="StatisticsIntroTimeSkipped">0s</p>
Expand Down Expand Up @@ -726,6 +736,12 @@ <h2>Changelog</h2>
<div>
<div class="line flex">
<h2>1.1.41</h2>
<ul>
<li>Block Disney Ads</li>
</ul>
</div>
<div class="line flex">
<p>1.1.40</p>
<ul>
<li>Netflix pause ad not getting removed when no video on screen</li>
<li>Change the volume if you scroll on the volume icon</li>
Expand Down
21 changes: 17 additions & 4 deletions chrome/popup/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const defaultSettings = {
profile: true,
showRating: true,
},
Disney: { skipIntro: true, skipCredits: true, watchCredits: false, speedSlider: true, showRating: true, selfAd: true },
Disney: { skipIntro: true, skipCredits: true, watchCredits: false, skipAd: true, speedSlider: true, showRating: true, selfAd: true },
Crunchyroll: {
skipIntro: true,
speedSlider: true,
Expand All @@ -98,7 +98,14 @@ const defaultSettings = {
},
HBO: { skipIntro: true, skipCredits: true, watchCredits: false, speedSlider: true, showRating: true },
Video: { playOnFullScreen: true, epilepsy: false, userAgent: true, doubleClick: true, scrollVolume: true },
Statistics: { AmazonAdTimeSkipped: 0, NetflixAdTimeSkipped: 0, IntroTimeSkipped: 0, RecapTimeSkipped: 0, SegmentsSkipped: 0 },
Statistics: {
AmazonAdTimeSkipped: 0,
NetflixAdTimeSkipped: 0,
DisneyAdTimeSkipped: 0,
IntroTimeSkipped: 0,
RecapTimeSkipped: 0,
SegmentsSkipped: 0,
},
General: {
Crunchyroll_profilePicture: null,
profileName: null,
Expand Down Expand Up @@ -216,6 +223,7 @@ async function setCheckboxesToSettings() {
// Ads
settings?.Amazon.blockFreevee &&
settings?.Netflix.skipAd &&
settings?.Disney.skipAd &&
getBooleanOfCategory("showRating") &&
getBooleanOfCategory("speedSlider") &&
// playOnFullScreen
Expand All @@ -226,7 +234,7 @@ async function setCheckboxesToSettings() {
VideoCheckboxes.forEach((key) => {
setButtonChecked("Video" + capitalizeFirstLetter(key), getBooleanOfCategory(key));
});
setButtonChecked("VideoAds", settings?.Amazon.blockFreevee && settings?.Netflix.skipAd);
setButtonChecked("VideoAds", settings?.Amazon.blockFreevee && settings?.Netflix.skipAd && settings?.Disney.skipAd);
setButtonChecked("VideoFullScreen", settings?.Video.playOnFullScreen);
setButtonChecked("VideoDoubleClick", settings?.Video.doubleClick);
setButtonChecked("VideoScrollVolume", settings?.Video.scrollVolume);
Expand Down Expand Up @@ -402,6 +410,7 @@ function listenForClicks() {
// Ads
settings?.Amazon.blockFreevee &&
settings?.Netflix.skipAd &&
settings?.Disney.skipAd &&
getBooleanOfCategory("showRating") &&
getBooleanOfCategory("speedSlider") &&
// playOnFullScreen
Expand All @@ -415,13 +424,17 @@ function listenForClicks() {
});
settings.Amazon.blockFreevee =
settings.Netflix.skipAd =
settings.Disney.skipAd =
settings.Video.playOnFullScreen =
settings.Video.doubleClick =
settings.Video.scrollVolume =
VideoSkips;
if (VideoSkips) setCategoryToBoolean("watchCredits", false);
} else if (e.target.id === "VideoAds")
settings.Amazon.blockFreevee = settings.Netflix.skipAd = !(settings?.Amazon.blockFreevee && settings?.Netflix.skipAd);
settings.Amazon.blockFreevee =
settings.Netflix.skipAd =
settings.Disney.skipAd =
!(settings?.Amazon.blockFreevee && settings?.Netflix.skipAd && settings?.Disney.skipAd);
else if (e.target.id === "VideoFullScreen") settings.Video.playOnFullScreen = !settings.Video.playOnFullScreen;
else if (e.target.id === "VideoDoubleClick") settings.Video.doubleClick = !settings.Video.doubleClick;
else if (e.target.id === "VideoScrollVolume") settings.Video.scrollVolume = !settings.Video.scrollVolume;
Expand Down
34 changes: 29 additions & 5 deletions chrome/skipper.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO
profile: true,
showRating: true,
},
Disney: { skipIntro: true, skipCredits: true, watchCredits: false, speedSlider: true, showRating: true, selfAd: true },
Disney: { skipIntro: true, skipCredits: true, watchCredits: false, skipAd: true, speedSlider: true, showRating: true, selfAd: true },
Crunchyroll: {
skipIntro: true,
speedSlider: true,
Expand All @@ -70,7 +70,14 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO
},
HBO: { skipIntro: true, skipCredits: true, watchCredits: false, speedSlider: true, showRating: true },
Video: { playOnFullScreen: true, epilepsy: false, userAgent: true, doubleClick: true, scrollVolume: true },
Statistics: { AmazonAdTimeSkipped: 0, NetflixAdTimeSkipped: 0, IntroTimeSkipped: 0, RecapTimeSkipped: 0, SegmentsSkipped: 0 },
Statistics: {
AmazonAdTimeSkipped: 0,
NetflixAdTimeSkipped: 0,
DisneyAdTimeSkipped: 0,
IntroTimeSkipped: 0,
RecapTimeSkipped: 0,
SegmentsSkipped: 0,
},
General: {
Crunchyroll_profilePicture: null,
profileName: null,
Expand Down Expand Up @@ -495,6 +502,23 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO
if (settings.Disney?.selfAd) Disney_selfAd(video, time);
}
if (settings.Video?.scrollVolume) Disney_scrollVolume(video);
if (settings.Disney?.skipAd) Disney_skipAd(video);
}
async function Disney_skipAd(video) {
if (video) {
const adTimeText = document.querySelector("div.overlay_interstitials__content_time_display");
if (adTimeText) {
const adTime = parseAdTime(adTimeText.textContent);
if (adTime >= 1 && !lastAdTimeText) {
lastAdTimeText = adTime;
resetLastATimeText(100);
video.currentTime += adTime;
log("Disney Ad skipped, length:", adTime, "s");
settings.Statistics.DisneyAdTimeSkipped += adTime;
increaseBadge();
}
}
}
}
async function Disney_scrollVolume(video) {
const volumeControl = document.querySelector("div.audio-control:not(.enhanced)");
Expand Down Expand Up @@ -1066,7 +1090,7 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO
}, 100);
}
function parseAdTime(adTimeText) {
const adTime = parseInt(/:\d+/.exec(adTimeText.textContent)?.[0].substring(1)) + parseInt(/\d+/.exec(adTimeText.textContent)?.[0]) * 60;
const adTime = parseInt(/:\d+/.exec(adTimeText)?.[0].substring(1)) + parseInt(/\d+/.exec(adTimeText)?.[0]) * 60;
if (isNaN(adTime)) return false;
return adTime;
}
Expand All @@ -1075,8 +1099,8 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO
const adTimeText = document.querySelector(".atvwebplayersdk-ad-timer-text");
if (adTimeText) {
let adTime;
adTime = parseAdTime(adTimeText?.childNodes?.[0]);
if (!adTime) adTime = parseAdTime(adTimeText?.childNodes?.[1]);
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;
Expand Down

0 comments on commit 29d2b25

Please sign in to comment.