Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamlinerm committed Jun 28, 2024
1 parent 76e0af1 commit b9f373c
Show file tree
Hide file tree
Showing 22 changed files with 72 additions and 69 deletions.
2 changes: 1 addition & 1 deletion chrome/_locales/de/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
"message": "Automatisch das letztes Profil auswählen:"
},
"ProfileSwitchDescription": {
"message": "Das zuletzt verwendete Netflix-Profil wird direkt beim Start der Seite ausgewählt"
"message": "Das zuletzt verwendete Profil wird direkt beim Start der Seite ausgewählt"
},
"User": {
"message": "Benutzer:"
Expand Down
2 changes: 1 addition & 1 deletion chrome/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
"message": "Auto pick last profile:"
},
"ProfileSwitchDescription": {
"message": "The last used Netflix profile is directly chosen when the page is launched"
"message": "The last used profile is directly chosen when the page is launched"
},
"User": {
"message": "User:"
Expand Down
2 changes: 1 addition & 1 deletion chrome/_locales/mk/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
"message": "Автоматски избирање на последниот одберен профил на Netflix:"
},
"ProfileSwitchDescription": {
"message": "Последниот користен профил на Netflix автоматски се избира кога ќе се одбере прв пат на Netflix"
"message": "Последниот користен профил на автоматски се избира кога ќе се одбере прв пат на"
},
"User": {
"message": "Профил:"
Expand Down
2 changes: 1 addition & 1 deletion chrome/_locales/pt_BR/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
"message": "Seleção automática do último perfil:"
},
"ProfileSwitchDescription": {
"message": "O último perfil da Netflix usado é escolhido diretamente quando a página é iniciada"
"message": "O último perfil da usado é escolhido diretamente quando a página é iniciada"
},
"User": {
"message": "Usuário:"
Expand Down
5 changes: 2 additions & 3 deletions chrome/cr.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ const defaultSettings = {
},
},
};
let settings = defaultSettings.settings;
const version = "1.1.18";
let settings = { ...defaultSettings.settings };
const version = "1.1.19";
chrome.storage.sync.get("settings", function (result) {
console.log(
"%cNetflix%c/%cPrime%c Auto-Skip",
Expand All @@ -66,7 +66,6 @@ chrome.storage.sync.get("settings", function (result) {
);
console.log("version:", version);
// overwrite default settings with user settings
settings = { ...defaultSettings.settings, ...result.settings };
// List of keys to merge individually
Object.keys(defaultSettings.settings).forEach((key) => {
if (result?.settings[key]) {
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.18",
"version": "1.1.19",

"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.18</p>
<p style="color: grey; font-size: 1em">v.1.1.19</p>
</div>
</div>
<a target="_blank" class="flex-center flex-col" style="text-align: center; text-decoration: none"
Expand Down
4 changes: 2 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.18</p>
<p style="font-size: 1em">v.1.1.19</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,7 @@ <h2 data-i18n>ImportSettings</h2>
<h2>Changelog</h2>
<div>
<div class="line flex">
<h2>1.1.18</h2>
<h2>1.1.18-19</h2>
<ul>
<li>Profile Pick not working
the same in deployed version</li>
Expand Down
1 change: 0 additions & 1 deletion chrome/popup/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ console.log("isMobile", isMobile, navigator.userAgent);
let settings = { ...defaultSettings.settings };
chrome.storage.sync.get("settings", function (result) {
// overwrite default settings with user settings
settings = { ...defaultSettings.settings, ...result.settings };
// List of keys to merge individually
Object.keys(defaultSettings.settings).forEach((key) => {
if (result?.settings[key]) {
Expand Down
46 changes: 25 additions & 21 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.18";
const version = "1.1.19";
if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO) {
/* eslint-env root:true */
// global variables in localStorage
Expand Down Expand Up @@ -76,7 +76,7 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO
},
},
};
let settings = defaultSettings.settings;
let settings = { ...defaultSettings.settings };
let DBCache = {};
let lastAdTimeText = 0;
let videoSpeed = 1;
Expand Down Expand Up @@ -133,9 +133,21 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO
if (Amazon?.continuePosition) setTimeout(() => Amazon_continuePosition(), 500);
if (settings.Video?.userAgent && isMobile) Amazon_customizeMobileView();
}
function startCrunchyroll(Crunchyroll) {
if (Crunchyroll?.releaseCalendar) Crunchyroll_ReleaseCalendar();
if (Crunchyroll?.profile) {
let pickInterval = setInterval(function () {
Crunchyroll_AutoPickProfile();
}, 100);
// only click on profile on page load not when switching profiles
setTimeout(function () {
clearInterval(pickInterval);
}, 2000);
CrunchyrollObserver.observe(document, config);
}
}
chrome.storage.sync.get("settings", function (result) {
// overwrite default settings with user settings
settings = { ...defaultSettings.settings, ...result.settings };
// List of keys to merge individually
Object.keys(defaultSettings.settings).forEach((key) => {
if (result?.settings[key]) {
Expand All @@ -148,11 +160,8 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO
if (isNetflix) startNetflix(settings.Netflix);
else if (isPrimeVideo) startAmazon(settings.Amazon);
else if (isDisney || isHotstar) DisneyObserver.observe(document, config);
else if (isCrunchyroll) {
Crunchyroll_ReleaseCalendar();
Crunchyroll_AutoPickProfile();
CrunchyrollObserver.observe(document, config);
} else if (isHBO) HBOObserver.observe(document, config);
else if (isCrunchyroll) startCrunchyroll(settings.Crunchyroll);
else if (isHBO) HBOObserver.observe(document, config);
if (settings?.Video?.playOnFullScreen) startPlayOnFullScreen();
});
chrome.storage.local.onChanged.addListener(function (changes) {
Expand Down Expand Up @@ -1176,7 +1185,7 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO
}
}
async function Crunchyroll_ReleaseCalendar() {
if (settings.Crunchyroll?.releaseCalendar && url.includes("simulcastcalendar")) {
if (url.includes("simulcastcalendar")) {
// Show playlist only
filterQueued(settings.General.filterQueued ? "none" : "block");
filterDub(settings.General.filterDub ? "none" : "block");
Expand All @@ -1199,18 +1208,13 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO
}
}
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 img")?.forEach((img) => {
if (img.src === settings.General.Crunchyroll_profilePicture) {
img.click();
log("Profile automatically chosen:", img.src);
increaseBadge();
}
});
// click on profile picture
if (document.querySelector(".profile-item-name")) {
document.querySelectorAll(".erc-profile-item img")?.forEach((img) => {
if (img.src === settings.General.Crunchyroll_profilePicture) {
img.click();
log("Profile automatically chosen:", img.src);
increaseBadge();
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion firefox/_locales/de/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
"message": "Automatisch das letztes Profil auswählen:"
},
"ProfileSwitchDescription": {
"message": "Das zuletzt verwendete Netflix-Profil wird direkt beim Start der Seite ausgewählt"
"message": "Das zuletzt verwendete Profil wird direkt beim Start der Seite ausgewählt"
},
"User": {
"message": "Benutzer:"
Expand Down
2 changes: 1 addition & 1 deletion firefox/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
"message": "Auto pick last profile:"
},
"ProfileSwitchDescription": {
"message": "The last used Netflix profile is directly chosen when the page is launched"
"message": "The last used profile is directly chosen when the page is launched"
},
"User": {
"message": "User:"
Expand Down
2 changes: 1 addition & 1 deletion firefox/_locales/mk/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
"message": "Автоматски избирање на последниот одберен профил на Netflix:"
},
"ProfileSwitchDescription": {
"message": "Последниот користен профил на Netflix автоматски се избира кога ќе се одбере прв пат на Netflix"
"message": "Последниот користен профил на автоматски се избира кога ќе се одбере прв пат на"
},
"User": {
"message": "Профил:"
Expand Down
2 changes: 1 addition & 1 deletion firefox/_locales/pt_BR/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
"message": "Seleção automática do último perfil:"
},
"ProfileSwitchDescription": {
"message": "O último perfil da Netflix usado é escolhido diretamente quando a página é iniciada"
"message": "O último perfil da usado é escolhido diretamente quando a página é iniciada"
},
"User": {
"message": "Usuário:"
Expand Down
3 changes: 1 addition & 2 deletions firefox/badge.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,9 @@ if (isMobile) {
},
},
};
let settings = defaultSettings.settings;
let settings = { ...defaultSettings.settings };
browser.storage.sync.get("settings", function (result) {
// overwrite default settings with user settings
settings = { ...defaultSettings.settings, ...result.settings };
// List of keys to merge individually
Object.keys(defaultSettings.settings).forEach((key) => {
if (result?.settings[key]) {
Expand Down
5 changes: 2 additions & 3 deletions firefox/cr.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ const defaultSettings = {
},
},
};
let settings = defaultSettings.settings;
const version = "1.1.18";
let settings = { ...defaultSettings.settings };
const version = "1.1.19";
browser.storage.sync.get("settings", function (result) {
console.log(
"%cNetflix%c/%cPrime%c Auto-Skip",
Expand All @@ -66,7 +66,6 @@ browser.storage.sync.get("settings", function (result) {
);
console.log("version:", version);
// overwrite default settings with user settings
settings = { ...defaultSettings.settings, ...result.settings };
// List of keys to merge individually
Object.keys(defaultSettings.settings).forEach((key) => {
if (result?.settings[key]) {
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.18",
"version": "1.1.19",
"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.18</p>
<p style="color: grey; font-size: 1em">v.1.1.19</p>
</div>
</div>
<a target="_blank" class="flex-center flex-col" style="text-align: center; text-decoration: none"
Expand Down
4 changes: 2 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.18</p>
<p style="font-size: 1em">v.1.1.19</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,7 @@ <h2 data-i18n>ImportSettings</h2>
<h2>Changelog</h2>
<div>
<div class="line flex">
<h2>1.1.18</h2>
<h2>1.1.18-19</h2>
<ul>
<li>Profile Pick not working
the same in deployed version</li>
Expand Down
1 change: 0 additions & 1 deletion firefox/popup/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ console.log("isMobile", isMobile, navigator.userAgent);
let settings = { ...defaultSettings.settings };
browser.storage.sync.get("settings", function (result) {
// overwrite default settings with user settings
settings = { ...defaultSettings.settings, ...result.settings };
// List of keys to merge individually
Object.keys(defaultSettings.settings).forEach((key) => {
if (result?.settings[key]) {
Expand Down
46 changes: 25 additions & 21 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.18";
const version = "1.1.19";
if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO) {
/* eslint-env root:true */
// global variables in localStorage
Expand Down Expand Up @@ -76,7 +76,7 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO
},
},
};
let settings = defaultSettings.settings;
let settings = { ...defaultSettings.settings };
let DBCache = {};
let lastAdTimeText = 0;
let videoSpeed = 1;
Expand Down Expand Up @@ -133,9 +133,21 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO
if (Amazon?.continuePosition) setTimeout(() => Amazon_continuePosition(), 500);
if (settings.Video?.userAgent && isMobile) Amazon_customizeMobileView();
}
function startCrunchyroll(Crunchyroll) {
if (Crunchyroll?.releaseCalendar) Crunchyroll_ReleaseCalendar();
if (Crunchyroll?.profile) {
let pickInterval = setInterval(function () {
Crunchyroll_AutoPickProfile();
}, 100);
// only click on profile on page load not when switching profiles
setTimeout(function () {
clearInterval(pickInterval);
}, 2000);
CrunchyrollObserver.observe(document, config);
}
}
browser.storage.sync.get("settings", function (result) {
// overwrite default settings with user settings
settings = { ...defaultSettings.settings, ...result.settings };
// List of keys to merge individually
Object.keys(defaultSettings.settings).forEach((key) => {
if (result?.settings[key]) {
Expand All @@ -148,11 +160,8 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO
if (isNetflix) startNetflix(settings.Netflix);
else if (isPrimeVideo) startAmazon(settings.Amazon);
else if (isDisney || isHotstar) DisneyObserver.observe(document, config);
else if (isCrunchyroll) {
Crunchyroll_ReleaseCalendar();
Crunchyroll_AutoPickProfile();
CrunchyrollObserver.observe(document, config);
} else if (isHBO) HBOObserver.observe(document, config);
else if (isCrunchyroll) startCrunchyroll(settings.Crunchyroll);
else if (isHBO) HBOObserver.observe(document, config);
if (settings?.Video?.playOnFullScreen) startPlayOnFullScreen();
});
browser.storage.local.onChanged.addListener(function (changes) {
Expand Down Expand Up @@ -1176,7 +1185,7 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO
}
}
async function Crunchyroll_ReleaseCalendar() {
if (settings.Crunchyroll?.releaseCalendar && url.includes("simulcastcalendar")) {
if (url.includes("simulcastcalendar")) {
// Show playlist only
filterQueued(settings.General.filterQueued ? "none" : "block");
filterDub(settings.General.filterDub ? "none" : "block");
Expand All @@ -1199,18 +1208,13 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO
}
}
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 img")?.forEach((img) => {
if (img.src === settings.General.Crunchyroll_profilePicture) {
img.click();
log("Profile automatically chosen:", img.src);
increaseBadge();
}
});
// click on profile picture
if (document.querySelector(".profile-item-name")) {
document.querySelectorAll(".erc-profile-item img")?.forEach((img) => {
if (img.src === settings.General.Crunchyroll_profilePicture) {
img.click();
log("Profile automatically chosen:", img.src);
increaseBadge();
}
});
}
Expand Down
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.18",
"version": "1.1.19",
"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 b9f373c

Please sign in to comment.