Skip to content

Commit

Permalink
version 1.0.78
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamlinerm committed Jan 10, 2024
1 parent 91d4aa4 commit 38c8701
Show file tree
Hide file tree
Showing 20 changed files with 126 additions and 42 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.

<div>
<div class="line flex">
<h2>1.0.77</h2>
<h2>1.0.78</h2>
<ul>
<li>Released for Firefox on Android</li>
</ul>
Expand Down
6 changes: 6 additions & 0 deletions chrome/_locales/de/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@
"PaidContentDescription": {
"message": "Entfernen aller bezahlten Serien/Filmkategorien"
},
"ContinuePositionSwitch": {
"message": "Kategorie \"Fortsetzen\" verschieben:"
},
"ContinuePositionDescription": {
"message": "Kategorie \"Fortsetzen\" an den Seitenanfang verschieben"
},
"FreeveeSwitch": {
"message": "Freevee-Werbungen überspringen:"
},
Expand Down
6 changes: 6 additions & 0 deletions chrome/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@
"PaidContentDescription": {
"message": "Removing every paid movie/series category"
},
"ContinuePositionSwitch": {
"message": "Move category \"Continue\":"
},
"ContinuePositionDescription": {
"message": "Move category \"Continue\" to the top of the page"
},
"FreeveeSwitch": {
"message": "Skip Freevee Ads:"
},
Expand Down
6 changes: 6 additions & 0 deletions chrome/_locales/mk/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@
"PaidContentDescription": {
"message": "Отстранување на секоја ТВ-серија/филм кој треба да се купи за да се гледа"
},
"ContinuePositionSwitch": {
"message": "Преместете ја категоријата „Продолжи“:"
},
"ContinuePositionDescription": {
"message": "Преместете ја категоријата „Продолжи“ на врвот на страницата"
},
"FreeveeSwitch": {
"message": "Прескокнете ги рекламите:"
},
Expand Down
8 changes: 7 additions & 1 deletion chrome/_locales/pt_BR/messages.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extensionName": {
"message": "Streaming enhanced: Netflix Disney+ Prime Video",
"message": "Streaming enhanced Netflix Disney Prime Video",
"description": "Nome da extensão"
},
"extensionDescription": {
Expand Down Expand Up @@ -130,6 +130,12 @@
"PaidContentDescription": {
"message": "Remoção de todas as categorias de filmes/séries pagos"
},
"ContinuePositionSwitch": {
"message": "Mover categoria \"Continuar\":"
},
"ContinuePositionDescription": {
"message": "Mova a categoria \"Continuar\" para o topo da página"
},
"FreeveeSwitch": {
"message": "Ignorar anúncios:"
},
Expand Down
3 changes: 2 additions & 1 deletion chrome/cr.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const defaultSettings = {
blockFreevee: true,
speedSlider: true,
filterPaid: false,
continuePosition: true,
showRating: true,
},
Netflix: {
Expand All @@ -42,7 +43,7 @@ const defaultSettings = {
},
};
let settings = defaultSettings.settings;
const version = "1.0.77";
const version = "1.0.78";
chrome.storage.sync.get("settings", function (result) {
console.log(
"%cNetflix%c/%cPrime%c Auto-Skip",
Expand Down
4 changes: 2 additions & 2 deletions chrome/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 3,
"name": "__MSG_extensionName__",
"description": "__MSG_extensionDescription__",
"version": "1.0.77",
"version": "1.0.78",

"homepage_url": "https://github.com/Dreamlinerm/Netflix-Prime-Auto-Skip",
"icons": {
Expand Down Expand Up @@ -35,7 +35,7 @@
"matches": ["https://static.crunchyroll.com/vilos-v2/web/vilos/player.html*"]
}
],
"permissions": ["storage"],
"permissions": ["storage", "activeTab"],
"action": {
"default_icon": {
"16": "icons/NetflixAmazon Auto-Skip--16.png",
Expand Down
9 changes: 8 additions & 1 deletion chrome/popup/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<img class="Logo" src="../icons/NetflixAmazon Auto-Skip.svg" />
<div class="flex-center flex-col">
<h2 class="title" i18n>pageTitle</h2>
<p style="color: grey; font-size: 1em">v.1.0.77</p>
<p style="color: grey; font-size: 1em">v.1.0.78</p>
</div>
</div>
<a
Expand Down Expand Up @@ -207,6 +207,13 @@ <h2 id="openAmazonSettings" i18n>PageSpecificTitle;Prime Video</h2>
<span class="slider round"></span>
</label>
</div>
<div class="line flex">
<p i18n>ContinuePositionSwitch</p>
<label class="switch">
<input type="checkbox" id="AmazonContinuePosition" />
<span class="slider round"></span>
</label>
</div>
<!-- <div class="line flex">
<p i18n>StreamLinksSwitch</p>
<label class="switch">
Expand Down
19 changes: 17 additions & 2 deletions chrome/popup/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<img class="Logo" src="../icons/NetflixAmazon Auto-Skip.svg" />
<div class="flex-center flex-col">
<h2 class="title" i18n>pageTitle</h2>
<p style="font-size: 1em">v.1.0.77</p>
<p style="font-size: 1em">v.1.0.78</p>
</div>
</div>
<a
Expand Down Expand Up @@ -508,6 +508,14 @@ <h2 i18n>PageSpecificTitle;Prime Video</h2>
</div>
<p class="description" i18n>PaidContentDescription</p>
<hr />
<div class="line flex">
<p i18n>ContinuePositionSwitch</p>
<label class="switch">
<input type="checkbox" id="AmazonContinuePosition" />
<span class="slider round"></span>
</label>
</div>
<p class="description" i18n>ContinuePositionDescription</p>

<!-- <div class="line flex">
<p i18n>StreamLinksSwitch</p>
Expand Down Expand Up @@ -752,7 +760,14 @@ <h2 i18n>ImportSettings</h2>
<h2>Changelog</h2>
<div>
<div class="line flex">
<h2>1.0.77</h2>
<h2>1.0.78</h2>
<ul>
<li>Mute Netflix Ad skip</li>
<li>Add Feature to Prime: move continue watching to the top</li>
</ul>
</div>
<div class="line flex">
<p>1.0.77</p>
<ul>
<li>Automatically use desktop mode on firefox/chrome mobile</li>
<li>Various mobile improvements</li>
Expand Down
8 changes: 6 additions & 2 deletions chrome/popup/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const defaultSettings = {
blockFreevee: true,
speedSlider: true,
filterPaid: false,
continuePosition: true,
showRating: true,
},
Netflix: {
Expand Down Expand Up @@ -198,7 +199,7 @@ function setCheckboxesToSettings() {
// ------------- Default ---------------------------------------
setButtonChecked("DefaultSkips", settings?.Amazon.filterPaid);
// ------------- global buttons ---------------------------------------
setButtonChecked("AmazonSkips", settings?.Amazon.skipAd && settings?.Amazon.filterPaid);
setButtonChecked("AmazonSkips", settings?.Amazon.skipAd && settings?.Amazon.filterPaid && settings?.Amazon.continuePosition);
setButtonChecked("NetflixSkips", settings?.Netflix.skipRecap && settings?.Netflix.skipBlocked && settings?.Netflix.profile);
setButtonChecked("DisneySkips", settings?.Disney.skipIntro);
setButtonChecked("CrunchyrollSkips", settings?.Crunchyroll.skipIntro && settings?.Crunchyroll.releaseCalendar);
Expand Down Expand Up @@ -362,7 +363,10 @@ function listenForClicks() {
else if (e.target.id === "DefaultSkips") settings.Amazon.filterPaid = !settings?.Amazon.filterPaid;
// ------------- Amazon ---------------------------------------
else if (e.target.id === "AmazonSkips")
settings.Amazon.skipAd = settings.Amazon.filterPaid = !(settings.Amazon.skipAd && settings.Amazon.filterPaid);
settings.Amazon.skipAd =
settings.Amazon.filterPaid =
settings.Amazon.continuePosition =
!(settings.Amazon.skipAd && settings.Amazon.filterPaid && settings.Amazon.continuePosition);
else if (e.target.id === "NetflixSkips")
settings.Netflix.skipRecap =
settings.Netflix.skipBlocked =
Expand Down
70 changes: 48 additions & 22 deletions chrome/skipper.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const isMobile = /mobile|streamingEnhanced/i.test(ua);
const isEdge = /edg/i.test(ua);
// const isFirefox = /firefox/i.test(ua);
// const isChrome = /chrome/i.test(ua);
const version = "1.0.77";
const version = "1.0.78";
if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll) {
/* eslint-env root:true */
// global variables in localStorage
Expand All @@ -41,6 +41,7 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll) {
blockFreevee: true,
speedSlider: true,
filterPaid: false,
continuePosition: true,
showRating: true,
},
Netflix: {
Expand Down Expand Up @@ -114,27 +115,8 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll) {
Amazon_FreeveeTimeout();
}, 1000);
}
// customize mobile view for desktop website
if (settings.Video?.userAgent && isMobile) {
if (!document.querySelector(AmazonVideoClass) && !url.includes("/gp/video/detail/")) {
// add <meta name="viewport" content="width=device-width, initial-scale=1" /> to head
let meta = document.createElement("meta");
meta.name = "viewport";
meta.content = "width=device-width, initial-scale=1";
document.head.appendChild(meta);

// make amazon more mobile friendly
let navBelt = document.querySelector("#nav-belt");
if (navBelt) {
navBelt.style.width = "100vw";
navBelt.style.display = "flex";
navBelt.style.flexDirection = "column";
navBelt.style.height = "fit-content";
}
let navMain = document.querySelector("#nav-main");
if (navMain) navMain.style.display = "none";
}
}
if (Amazon?.continuePosition) Amazon_continuePosition();
if (settings.Video?.userAgent && isMobile) Amazon_customizeMobileView();
}
chrome.storage.sync.get("settings", function (result) {
// if there is an undefined setting, set it to the default
Expand Down Expand Up @@ -178,6 +160,7 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll) {
function AmazonSettingsChanged(oldValue, newValue) {
if (!oldValue?.skipAd && newValue.skipAd) Amazon_AdTimeout();
if (!oldValue?.blockFreevee && newValue.blockFreevee) Amazon_FreeveeTimeout();
if (!oldValue?.continuePosition && newValue.continuePosition) Amazon_continuePosition();
}
function DisneySettingsChanged(oldValue, newValue) {
if (!oldValue?.showRating && newValue.showRating) startShowRatingInterval();
Expand Down Expand Up @@ -596,6 +579,7 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll) {
settings.Statistics.NetflixAdTimeSkipped += adLength;
increaseBadge();
if (settings.Video.epilepsy) video.style.opacity = 0;
video.muted = true;
video.playbackRate = playBackRate;
lastAdTimeText = adLength;
} else if (adLength > 2 && video.playbackRate < 2) {
Expand All @@ -606,6 +590,7 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll) {
// added lastAdTimeText because other speedsliders are not working anymore
} else if (adLength <= 2 || (!adLength && lastAdTimeText)) {
// videospeed is speedSlider value
video.muted = false;
video.playbackRate = videoSpeed;
lastAdTimeText = 0;
if (settings.Video.epilepsy) video.style.opacity = 1;
Expand Down Expand Up @@ -752,6 +737,24 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll) {
}
}
}
async function Amazon_continuePosition() {
const div = document.querySelector("._2RwnU5.dynamic-type-ramp.dv-fable-breakpoints.VYbJYb.yL46mS.kK-hEr");
if (div) {
let a = document.querySelector('.j5ZgN-.r0m8Kk._0rmWBt[data-testid="card-overlay"]');
let maxSectionDepth = 10;
while (a?.parentElement && maxSectionDepth > 0) {
a = a.parentElement;
maxSectionDepth--;
if (a?.classList?.contains("+OSZzQ")) break;
}
const insertBefore = div.childNodes[2];
if (a && insertBefore) {
// move continue category to the top
div.insertBefore(a, insertBefore);
// continueCategory.remove();
}
}
}
async function Amazon_FilterPaid() {
// if not on the shop page or homepremiere
if (!url.includes("contentId=store") && !url.includes("contentId=homepremiere") && !url.includes("contentType=merch")) {
Expand Down Expand Up @@ -857,6 +860,29 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll) {
}
}, 100);
}

async function Amazon_customizeMobileView() {
console.log("customizeMobileView");
// customize mobile view for desktop website
if (!document.querySelector(AmazonVideoClass) && !url.includes("/gp/video/detail/")) {
// add <meta name="viewport" content="width=device-width, initial-scale=1" /> to head
let meta = document.createElement("meta");
meta.name = "viewport";
meta.content = "width=device-width, initial-scale=1";
document.head.appendChild(meta);

// make amazon more mobile friendly
let navBelt = document.querySelector("#nav-belt");
if (navBelt) {
navBelt.style.width = "100vw";
navBelt.style.display = "flex";
navBelt.style.flexDirection = "column";
navBelt.style.height = "fit-content";
}
let navMain = document.querySelector("#nav-main");
if (navMain) navMain.style.display = "none";
}
}
// Crunchyroll functions
function filterQueued(display) {
document.querySelectorAll("div.queue-flag:not(.queued)").forEach((element) => {
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion firefox/cr.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const defaultSettings = {
},
};
let settings = defaultSettings.settings;
const version = "1.0.77";
const version = "1.0.78";
browser.storage.sync.get("settings", function (result) {
console.log(
"%cNetflix%c/%cPrime%c Auto-Skip",
Expand Down
2 changes: 1 addition & 1 deletion firefox/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "__MSG_extensionName__",
"description": "__MSG_extensionDescription__",
"version": "1.0.77",
"version": "1.0.78",
"homepage_url": "https://github.com/Dreamlinerm/Netflix-Prime-Auto-Skip",
"icons": {
"16": "icons/NetflixAmazon Auto-Skip.svg",
Expand Down
2 changes: 1 addition & 1 deletion firefox/popup/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<img class="Logo" src="../icons/NetflixAmazon Auto-Skip.svg" />
<div class="flex-center flex-col">
<h2 class="title" i18n>pageTitle</h2>
<p style="color: grey; font-size: 1em">v.1.0.77</p>
<p style="color: grey; font-size: 1em">v.1.0.78</p>
</div>
</div>
<a
Expand Down
12 changes: 10 additions & 2 deletions firefox/popup/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<img class="Logo" src="../icons/NetflixAmazon Auto-Skip.svg" />
<div class="flex-center flex-col">
<h2 class="title" i18n>pageTitle</h2>
<p style="font-size: 1em">v.1.0.77</p>
<p style="font-size: 1em">v.1.0.78</p>
</div>
</div>
<a
Expand Down Expand Up @@ -508,6 +508,14 @@ <h2 i18n>PageSpecificTitle;Prime Video</h2>
</div>
<p class="description" i18n>PaidContentDescription</p>
<hr />
<div class="line flex">
<p i18n>ContinuePositionSwitch</p>
<label class="switch">
<input type="checkbox" id="AmazonContinuePosition" />
<span class="slider round"></span>
</label>
</div>
<p class="description" i18n>ContinuePositionDescription</p>

<!-- <div class="line flex">
<p i18n>StreamLinksSwitch</p>
Expand Down Expand Up @@ -759,7 +767,7 @@ <h2>1.0.78</h2>
</ul>
</div>
<div class="line flex">
<h2>1.0.77</h2>
<p>1.0.77</p>
<ul>
<li>Automatically use desktop mode on firefox/chrome mobile</li>
<li>Various mobile improvements</li>
Expand Down
3 changes: 1 addition & 2 deletions firefox/skipper.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const isMobile = /mobile|streamingEnhanced/i.test(ua);
const isEdge = /edg/i.test(ua);
// const isFirefox = /firefox/i.test(ua);
// const isChrome = /chrome/i.test(ua);
const version = "1.0.77";
const version = "1.0.78";
if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll) {
/* eslint-env root:true */
// global variables in localStorage
Expand Down Expand Up @@ -750,7 +750,6 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll) {
const insertBefore = div.childNodes[2];
if (a && insertBefore) {
// move continue category to the top
console.log(div, a, insertBefore);
div.insertBefore(a, insertBefore);
// continueCategory.remove();
}
Expand Down
Binary file not shown.
Loading

0 comments on commit 38c8701

Please sign in to comment.