Skip to content

Commit

Permalink
added Watch Credits feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamlinerm committed Aug 22, 2023
1 parent 92cc9ec commit 5459b34
Show file tree
Hide file tree
Showing 5 changed files with 177 additions and 29 deletions.
13 changes: 13 additions & 0 deletions firefox/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -209,5 +209,18 @@
},
"noWrap": {
"message": "nowrap"
},

"WatchCreditsSwitch": {
"message": "Watch Credits:"
},
"WatchCreditsSwitchDescription": {
"message": "Always watch the credits of every series"
},
"gotoIndividual": {
"message": "For the individual settings of the streaming services go to the "
},
"extendedSettings": {
"message": "extended Settings"
}
}
10 changes: 10 additions & 0 deletions firefox/popup/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,22 @@ <h2 id="openVideoSettings" i18n>SharedPageTitle</h2>
<span class="slider round"></span>
</label>
</div>
<hr />
<div class="line flex">
<p i18n>CreditsSwitch</p>
<label class="switch">
<input type="checkbox" id="VideoCredits" />
<span class="slider round"></span>
</label>
</div>
<div class="line flex">
<p i18n>WatchCreditsSwitch</p>
<label class="switch">
<input type="checkbox" id="VideoWatchCredits" />
<span class="slider round"></span>
</label>
</div>
<hr />
<div class="line flex">
<p i18n>AdsSwitch</p>
<label class="switch">
Expand All @@ -103,6 +112,7 @@ <h2 id="openVideoSettings" i18n>SharedPageTitle</h2>
<span class="slider round"></span>
</label>
</div>
<div class="line" style="width: 400px"><i18n>gotoIndividual</i18n><a href="settings.html" target="_blank" style="color: white" i18n>extendedSettings</a></div>
</div>
</div>
<div class="categoryPrime">
Expand Down
39 changes: 38 additions & 1 deletion firefox/popup/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,15 @@ <h2 i18n>SharedPageTitle</h2>
</div>
<p class="description" i18n>CreditsSwitchDescription</p>
<hr />
<div class="line flex">
<p i18n>WatchCreditsSwitch</p>
<label class="switch">
<input type="checkbox" id="VideoWatchCredits" />
<span class="slider round"></span>
</label>
</div>
<p class="description" i18n>WatchCreditsSwitchDescription</p>
<hr />
<div class="line flex">
<p i18n>AdsSwitch</p>
<label class="switch">
Expand Down Expand Up @@ -254,6 +263,13 @@ <h2 i18n>sharedSettings</h2>
<span class="slider round"></span>
</label>
</div>
<div class="line flex">
<p i18n>WatchCreditsSwitch</p>
<label class="switch">
<input type="checkbox" id="AmazonWatchCredits" />
<span class="slider round"></span>
</label>
</div>
<div class="line flex">
<p i18n>FreeveeSwitch</p>
<label class="switch">
Expand Down Expand Up @@ -327,6 +343,13 @@ <h2 i18n>sharedSettings</h2>
<span class="slider round"></span>
</label>
</div>
<div class="line flex">
<p i18n>WatchCreditsSwitch</p>
<label class="switch">
<input type="checkbox" id="NetflixWatchCredits" />
<span class="slider round"></span>
</label>
</div>
<div class="line flex">
<p i18n>AdsSwitch</p>
<label class="switch">
Expand Down Expand Up @@ -368,6 +391,13 @@ <h2 i18n>sharedSettings</h2>
<span class="slider round"></span>
</label>
</div>
<div class="line flex">
<p i18n>WatchCreditsSwitch</p>
<label class="switch">
<input type="checkbox" id="DisneyWatchCredits" />
<span class="slider round"></span>
</label>
</div>
<div class="line flex">
<p i18n>SliderSwitch</p>
<label class="switch">
Expand Down Expand Up @@ -425,7 +455,14 @@ <h2 i18n>ImportSettings</h2>
<h2>Changelog</h2>
<div>
<div class="line flex">
<h2>1.0.53</h2>
<h2>1.0.54</h2>
<ul>
<li>added Allways Watch Credits feature</li>
<li>fixed Shared Features Switches</li>
</ul>
</div>
<div class="line flex">
<p>1.0.53</p>
<ul>
<li>Fixed chrome pop-up wrong width</li>
</ul>
Expand Down
48 changes: 33 additions & 15 deletions firefox/popup/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ if (url.includes("#")) Menu(url.split("#")[1]);
// global variables in localStorage
const defaultSettings = {
settings: {
Amazon: { skipIntro: true, skipCredits: true, skipAd: true, blockFreevee: true, speedSlider: true, filterPaid: false },
Netflix: { skipIntro: true, skipRecap: true, skipCredits: true, skipBlocked: true, NetflixAds: true, speedSlider: true, profile: true },
Disney: { skipIntro: true, skipCredits: true, speedSlider: true },
Amazon: { skipIntro: true, skipCredits: true, watchCredits: true, skipAd: true, blockFreevee: true, speedSlider: true, filterPaid: false },
Netflix: { skipIntro: true, skipRecap: true, skipCredits: true, watchCredits: true, skipBlocked: true, NetflixAds: true, speedSlider: true, profile: true },
Disney: { skipIntro: true, skipCredits: true, watchCredits: true, speedSlider: true },
Video: { playOnFullScreen: true },
Statistics: { AmazonAdTimeSkipped: 0, NetflixAdTimeSkipped: 0, IntroTimeSkipped: 0, RecapTimeSkipped: 0, SegmentsSkipped: 0 },
General: { profileName: null, profilePicture: null, sliderSteps: 1, sliderMin: 5, sliderMax: 20 },
Expand Down Expand Up @@ -151,6 +151,8 @@ function setCheckboxesToSettings() {
if (button) button.checked = settings?.Amazon.skipIntro && settings?.Netflix.skipIntro && settings?.Disney.skipIntro;
button = document.querySelector("#VideoCredits");
if (button) button.checked = settings?.Amazon.skipCredits && settings?.Netflix.skipCredits && settings?.Disney.skipCredits;
button = document.querySelector("#VideoWatchCredits");
if (button) button.checked = settings?.Amazon.watchCredits && settings?.Netflix.watchCredits && settings?.Disney.watchCredits;
button = document.querySelector("#VideoAds");
if (button) button.checked = settings?.Amazon.blockFreevee && settings?.Netflix.NetflixAds;
button = document.querySelector("#VideoSpeedSlider");
Expand All @@ -169,6 +171,8 @@ function setCheckboxesToSettings() {
if (button) button.checked = settings?.Amazon.skipIntro;
button = document.querySelector("#AmazonCredits");
if (button) button.checked = settings?.Amazon.skipCredits;
button = document.querySelector("#AmazonWatchCredits");
if (button) button.checked = settings?.Amazon.watchCredits;
button = document.querySelector("#AmazonAds");
if (button) button.checked = settings?.Amazon.skipAd;
button = document.querySelector("#AmazonFreevee");
Expand All @@ -189,6 +193,8 @@ function setCheckboxesToSettings() {
if (button) button.checked = settings?.Netflix.skipRecap;
button = document.querySelector("#NetflixCredits");
if (button) button.checked = settings?.Netflix.skipCredits;
button = document.querySelector("#NetflixWatchCredits");
if (button) button.checked = settings?.Netflix.watchCredits;
button = document.querySelector("#NetflixBlocked");
if (button) button.checked = settings?.Netflix.skipBlocked;
button = document.querySelector("#NetflixAds");
Expand All @@ -213,6 +219,8 @@ function setCheckboxesToSettings() {
if (button) button.checked = settings?.Disney.skipIntro;
button = document.querySelector("#DisneyCredits");
if (button) button.checked = settings?.Disney.skipCredits;
button = document.querySelector("#DisneyWatchCredits");
if (button) button.checked = settings?.Disney.watchCredits;
button = document.querySelector("#DisneySpeedSlider");
if (button) button.checked = settings?.Disney.speedSlider;

Expand Down Expand Up @@ -356,23 +364,24 @@ function listenForClicks() {
VideoSkips;
setSettings("All VideoSkips");
} else if (e.target.id === "VideoIntro") {
settings.Amazon.skipIntro = !settings.Amazon.skipIntro;
settings.Netflix.skipIntro = !settings.Netflix.skipIntro;
settings.Disney.skipIntro = !settings.Disney.skipIntro;
const skipIntro = settings?.Amazon.skipIntro && settings?.Netflix.skipIntro && settings?.Disney.skipIntro;
settings.Amazon.skipIntro = settings.Netflix.skipIntro = settings.Disney.skipIntro = !skipIntro;
setSettings("VideoIntro");
} else if (e.target.id === "VideoCredits") {
settings.Amazon.skipCredits = !settings.Amazon.skipCredits;
settings.Netflix.skipCredits = !settings.Netflix.skipCredits;
settings.Disney.skipCredits = !settings.Disney.skipCredits;
const skipCredits = settings?.Amazon.skipCredits && settings?.Netflix.skipCredits && settings?.Disney.skipCredits;
settings.Amazon.skipCredits = settings.Netflix.skipCredits = settings.Disney.skipCredits = !skipCredits;
setSettings("VideoCredits");
} else if (e.target.id === "VideoWatchCredits") {
const watchCredits = settings?.Amazon.watchCredits && settings?.Netflix.watchCredits && settings?.Disney.watchCredits;
settings.Amazon.watchCredits = settings.Netflix.watchCredits = settings.Disney.watchCredits = !watchCredits;
setSettings("VideoWatchCredits");
} else if (e.target.id === "VideoAds") {
settings.Amazon.blockFreevee = !settings.Amazon.blockFreevee;
settings.Netflix.NetflixAds = !settings.Netflix.NetflixAds;
const skipAd = settings?.Amazon.blockFreevee && settings?.Netflix.NetflixAds;
settings.Amazon.blockFreevee = settings.Netflix.NetflixAds = !skipAd;
setSettings("VideoAd");
} else if (e.target.id === "VideoSpeedSlider") {
settings.Amazon.speedSlider = !settings.Amazon.speedSlider;
settings.Netflix.speedSlider = !settings.Netflix.speedSlider;
settings.Disney.speedSlider = !settings.Disney.speedSlider;
const speedSlider = settings?.Amazon.speedSlider && settings?.Netflix.speedSlider && settings?.Disney.speedSlider;
settings.Amazon.speedSlider = settings.Netflix.speedSlider = settings.Disney.speedSlider = !speedSlider;
setSettings("VideoSpeedSlider");
} else if (e.target.id === "VideoFullScreen") {
settings.Video.playOnFullScreen = !settings.Video.playOnFullScreen;
Expand All @@ -394,6 +403,9 @@ function listenForClicks() {
} else if (e.target.id === "AmazonCredits") {
settings.Amazon.skipCredits = !settings.Amazon.skipCredits;
setSettings("AmazonCredits");
} else if (e.target.id === "AmazonWatchCredits") {
settings.Amazon.watchCredits = !settings.Amazon.watchCredits;
setSettings("AmazonWatchCredits");
} else if (e.target.id === "AmazonIntro") {
settings.Amazon.skipIntro = !settings.Amazon.skipIntro;
setSettings("AmazonIntro");
Expand Down Expand Up @@ -424,7 +436,10 @@ function listenForClicks() {
} else if (e.target.id === "NetflixCredits") {
settings.Netflix.skipCredits = !settings.Netflix.skipCredits;
setSettings("NetflixCredits");
} else if (e.target.id === "NetflixBlocked") {
} else if (e.target.id === "NetflixWatchCredits") {
settings.Netflix.watchCredits = !settings.Netflix.watchCredits;
setSettings("NetflixWatchCredits");
} else if (e.target.id === "NetflixWatchCredits") {
settings.Netflix.skipBlocked = !settings.Netflix.skipBlocked;
setSettings("NetflixBlocked");
} else if (e.target.id === "NetflixAds") {
Expand All @@ -448,6 +463,9 @@ function listenForClicks() {
} else if (e.target.id === "DisneyCredits") {
settings.Disney.skipCredits = !settings.Disney.skipCredits;
setSettings("DisneyCredits");
} else if (e.target.id === "DisneyWatchCredits") {
settings.Disney.watchCredits = !settings.Disney.watchCredits;
setSettings("DisneyWatchCredits");
} else if (e.target.id === "DisneySpeedSlider") {
settings.Disney.speedSlider = !settings.Disney.speedSlider;
setSettings("DisneySpeedSlider");
Expand Down
Loading

0 comments on commit 5459b34

Please sign in to comment.