Skip to content

Commit

Permalink
version 1.1.18
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamlinerm committed Jun 28, 2024
1 parent 6408353 commit 76e0af1
Show file tree
Hide file tree
Showing 11 changed files with 81 additions and 63 deletions.
2 changes: 1 addition & 1 deletion chrome/cr.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const defaultSettings = {
},
};
let settings = defaultSettings.settings;
const version = "1.1.17";
const version = "1.1.18";
chrome.storage.sync.get("settings", function (result) {
console.log(
"%cNetflix%c/%cPrime%c Auto-Skip",
Expand Down
2 changes: 1 addition & 1 deletion 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.1.17",
"version": "1.1.18",

"homepage_url": "https://github.com/Dreamlinerm/Netflix-Prime-Auto-Skip",
"icons": {
Expand Down
2 changes: 1 addition & 1 deletion chrome/popup/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<img class="Logo" src="../icons/NetflixAmazon Auto-Skip.svg" alt="Logo">
<div class="flex-center flex-col">
<h2 class="title" data-i18n>pageTitle</h2>
<p style="color: grey; font-size: 1em">v.1.1.17</p>
<p style="color: grey; font-size: 1em">v.1.1.18</p>
</div>
</div>
<a target="_blank" class="flex-center flex-col" style="text-align: center; text-decoration: none"
Expand Down
11 changes: 9 additions & 2 deletions chrome/popup/settings.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" alt="Logo">
<div class="flex-center flex-col">
<h2 class="title" data-i18n>pageTitle</h2>
<p style="font-size: 1em">v.1.1.17</p>
<p style="font-size: 1em">v.1.1.18</p>
</div>
</div>
<a target="_blank" class="flex-center flex-col" style="text-align: center; text-decoration: none"
Expand Down Expand Up @@ -681,7 +681,14 @@ <h2 data-i18n>ImportSettings</h2>
<h2>Changelog</h2>
<div>
<div class="line flex">
<h2>1.1.17</h2>
<h2>1.1.18</h2>
<ul>
<li>Profile Pick not working
the same in deployed version</li>
</ul>
</div>
<div class="line flex">
<p>1.1.17</p>
<ul>
<li>Forgot to add Crunchyroll Profile Auto pick to settings</li>
</ul>
Expand Down
54 changes: 28 additions & 26 deletions chrome/skipper.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,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.1.17";
const version = "1.1.18";
if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO) {
/* eslint-env root:true */
// global variables in localStorage
Expand Down Expand Up @@ -150,7 +150,8 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO
else if (isDisney || isHotstar) DisneyObserver.observe(document, config);
else if (isCrunchyroll) {
Crunchyroll_ReleaseCalendar();
Crunchyroll_profile();
Crunchyroll_AutoPickProfile();
CrunchyrollObserver.observe(document, config);
} else if (isHBO) HBOObserver.observe(document, config);
if (settings?.Video?.playOnFullScreen) startPlayOnFullScreen();
});
Expand Down Expand Up @@ -651,11 +652,7 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO
// small profile picture
settings.General.profilePicture = currentProfile?.firstChild?.firstChild?.src;
settings.General.profileName = currentProfileName;
try {
chrome.storage.sync.set({ settings });
} catch (error) {
log(error);
}
setStorage();
log("Profile switched to", currentProfileName);
}
}
Expand Down Expand Up @@ -1043,11 +1040,7 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO
input.onclick = function () {
settings.General[filterType] = this.checked;
filterFunction(this.checked ? "none" : "block");
try {
chrome.storage.sync.set({ settings });
} catch (error) {
log(error);
}
setStorage();
};
const p = document.createElement("p");
p.style = "width: 100px;";
Expand Down Expand Up @@ -1168,7 +1161,7 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO
const isCurrentWeek = clickOnCurrentDay();
const oldList = localList.length > 0 ? filterOldList(isCurrentWeek, localList) : settings.General.savedCrunchyList || [];
settings.General.savedCrunchyList = localList.concat(oldList);
chrome.storage.sync.set({ settings });
setStorage();
if (isCurrentWeek && !document.querySelector("div.queue-flag.queued.enhanced")) {
// now add the old list to the website list
document.querySelectorAll("section.calendar-day").forEach((element) => {
Expand All @@ -1192,31 +1185,33 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO
addSavedCrunchyList();
}
}
const CrunchyrollObserver = new MutationObserver(Crunchyroll);
async function Crunchyroll() {
if (settings.Crunchyroll?.profile) Crunchyroll_profile();
}
async function Crunchyroll_profile() {
// save profile
let img = document.querySelector(".erc-authenticated-user-menu img");
if (img && img.src !== settings.General.Crunchyroll_profilePicture) {
settings.General.Crunchyroll_profilePicture = img.src;
setStorage();
log("Profile switched to", img.src);
}
}
async function Crunchyroll_AutoPickProfile() {
if (settings.Crunchyroll?.profile) {
window.addEventListener("load", function () {
log("Window Loaded");
// click on profile picture
if (document.querySelector(".profile-item-name")) {
document.querySelectorAll(".erc-profile-item")?.forEach((name) => {
let img = name.querySelector("img");
document.querySelectorAll(".erc-profile-item img")?.forEach((img) => {
if (img.src === settings.General.Crunchyroll_profilePicture) {
img.click();
log("Profile automatically chosen:", img.src);
increaseBadge();
}
});
}
// save profile
let img = document.querySelector(".erc-authenticated-user-menu img");
if (img && img.src !== settings.General.Crunchyroll_profilePicture) {
settings.General.Crunchyroll_profilePicture = img.src;
try {
chrome.storage.sync.set({ settings });
} catch (error) {
log(error);
}
log("Profile switched to", img.src);
}
});
}
}
Expand Down Expand Up @@ -1308,4 +1303,11 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO
log(error);
}
}
async function setStorage() {
try {
chrome.storage.sync.set({ settings });
} catch (error) {
log(error);
}
}
}
2 changes: 1 addition & 1 deletion firefox/cr.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const defaultSettings = {
},
};
let settings = defaultSettings.settings;
const version = "1.1.17";
const version = "1.1.18";
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.1.17",
"version": "1.1.18",
"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 @@ -32,7 +32,7 @@
<img class="Logo" src="../icons/NetflixAmazon Auto-Skip.svg" alt="Logo">
<div class="flex-center flex-col">
<h2 class="title" data-i18n>pageTitle</h2>
<p style="color: grey; font-size: 1em">v.1.1.17</p>
<p style="color: grey; font-size: 1em">v.1.1.18</p>
</div>
</div>
<a target="_blank" class="flex-center flex-col" style="text-align: center; text-decoration: none"
Expand Down
11 changes: 9 additions & 2 deletions firefox/popup/settings.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" alt="Logo">
<div class="flex-center flex-col">
<h2 class="title" data-i18n>pageTitle</h2>
<p style="font-size: 1em">v.1.1.17</p>
<p style="font-size: 1em">v.1.1.18</p>
</div>
</div>
<a target="_blank" class="flex-center flex-col" style="text-align: center; text-decoration: none"
Expand Down Expand Up @@ -681,7 +681,14 @@ <h2 data-i18n>ImportSettings</h2>
<h2>Changelog</h2>
<div>
<div class="line flex">
<h2>1.1.17</h2>
<h2>1.1.18</h2>
<ul>
<li>Profile Pick not working
the same in deployed version</li>
</ul>
</div>
<div class="line flex">
<p>1.1.17</p>
<ul>
<li>Forgot to add Crunchyroll Profile Auto pick to settings</li>
</ul>
Expand Down
54 changes: 28 additions & 26 deletions firefox/skipper.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,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.1.17";
const version = "1.1.18";
if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO) {
/* eslint-env root:true */
// global variables in localStorage
Expand Down Expand Up @@ -150,7 +150,8 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO
else if (isDisney || isHotstar) DisneyObserver.observe(document, config);
else if (isCrunchyroll) {
Crunchyroll_ReleaseCalendar();
Crunchyroll_profile();
Crunchyroll_AutoPickProfile();
CrunchyrollObserver.observe(document, config);
} else if (isHBO) HBOObserver.observe(document, config);
if (settings?.Video?.playOnFullScreen) startPlayOnFullScreen();
});
Expand Down Expand Up @@ -651,11 +652,7 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO
// small profile picture
settings.General.profilePicture = currentProfile?.firstChild?.firstChild?.src;
settings.General.profileName = currentProfileName;
try {
browser.storage.sync.set({ settings });
} catch (error) {
log(error);
}
setStorage();
log("Profile switched to", currentProfileName);
}
}
Expand Down Expand Up @@ -1043,11 +1040,7 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO
input.onclick = function () {
settings.General[filterType] = this.checked;
filterFunction(this.checked ? "none" : "block");
try {
browser.storage.sync.set({ settings });
} catch (error) {
log(error);
}
setStorage();
};
const p = document.createElement("p");
p.style = "width: 100px;";
Expand Down Expand Up @@ -1168,7 +1161,7 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO
const isCurrentWeek = clickOnCurrentDay();
const oldList = localList.length > 0 ? filterOldList(isCurrentWeek, localList) : settings.General.savedCrunchyList || [];
settings.General.savedCrunchyList = localList.concat(oldList);
browser.storage.sync.set({ settings });
setStorage();
if (isCurrentWeek && !document.querySelector("div.queue-flag.queued.enhanced")) {
// now add the old list to the website list
document.querySelectorAll("section.calendar-day").forEach((element) => {
Expand All @@ -1192,31 +1185,33 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO
addSavedCrunchyList();
}
}
const CrunchyrollObserver = new MutationObserver(Crunchyroll);
async function Crunchyroll() {
if (settings.Crunchyroll?.profile) Crunchyroll_profile();
}
async function Crunchyroll_profile() {
// save profile
let img = document.querySelector(".erc-authenticated-user-menu img");
if (img && img.src !== settings.General.Crunchyroll_profilePicture) {
settings.General.Crunchyroll_profilePicture = img.src;
setStorage();
log("Profile switched to", img.src);
}
}
async function Crunchyroll_AutoPickProfile() {
if (settings.Crunchyroll?.profile) {
window.addEventListener("load", function () {
log("Window Loaded");
// click on profile picture
if (document.querySelector(".profile-item-name")) {
document.querySelectorAll(".erc-profile-item")?.forEach((name) => {
let img = name.querySelector("img");
document.querySelectorAll(".erc-profile-item img")?.forEach((img) => {
if (img.src === settings.General.Crunchyroll_profilePicture) {
img.click();
log("Profile automatically chosen:", img.src);
increaseBadge();
}
});
}
// save profile
let img = document.querySelector(".erc-authenticated-user-menu img");
if (img && img.src !== settings.General.Crunchyroll_profilePicture) {
settings.General.Crunchyroll_profilePicture = img.src;
try {
browser.storage.sync.set({ settings });
} catch (error) {
log(error);
}
log("Profile switched to", img.src);
}
});
}
}
Expand Down Expand Up @@ -1308,4 +1303,11 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO
log(error);
}
}
async function setStorage() {
try {
browser.storage.sync.set({ settings });
} catch (error) {
log(error);
}
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "streaming-enhanced",
"version": "1.1.17",
"version": "1.1.18",
"description": "Automatically skip Ads, Intros, Credits and add Speed Control, etc. on Netflix, Prime video, Disney+ & Hotstar and Crunchyroll.",
"scripts": {
"start": "web-ext run",
Expand Down

0 comments on commit 76e0af1

Please sign in to comment.