mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-19 14:09:09 +03:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bd4fbcc93d | ||
|
|
f1839eef94 | ||
|
|
3e3abf36e5 |
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "__MSG_fullName__",
|
"name": "__MSG_fullName__",
|
||||||
"short_name": "SponsorBlock",
|
"short_name": "SponsorBlock",
|
||||||
"version": "4.4",
|
"version": "4.4.1",
|
||||||
"default_locale": "en",
|
"default_locale": "en",
|
||||||
"description": "__MSG_Description__",
|
"description": "__MSG_Description__",
|
||||||
"homepage_url": "https://sponsor.ajay.app",
|
"homepage_url": "https://sponsor.ajay.app",
|
||||||
|
|||||||
@@ -656,6 +656,8 @@ function setupVideoListeners() {
|
|||||||
if (!Config.config.disableSkipping) {
|
if (!Config.config.disableSkipping) {
|
||||||
switchingVideos = false;
|
switchingVideos = false;
|
||||||
|
|
||||||
|
let startedWaiting = false;
|
||||||
|
|
||||||
video.addEventListener('play', () => {
|
video.addEventListener('play', () => {
|
||||||
// If it is not the first event, then the only way to get to 0 is if there is a seek event
|
// If it is not the first event, then the only way to get to 0 is if there is a seek event
|
||||||
// This check makes sure that changing the video resolution doesn't cause the extension to think it
|
// This check makes sure that changing the video resolution doesn't cause the extension to think it
|
||||||
@@ -687,6 +689,12 @@ function setupVideoListeners() {
|
|||||||
video.addEventListener('playing', () => {
|
video.addEventListener('playing', () => {
|
||||||
updateVirtualTime();
|
updateVirtualTime();
|
||||||
|
|
||||||
|
if (startedWaiting) {
|
||||||
|
startedWaiting = false;
|
||||||
|
console.warn(`[SB] Starting schedule after buffering: ${Math.abs(lastCheckVideoTime - video.currentTime) > 0.3
|
||||||
|
|| (lastCheckVideoTime !== video.currentTime && Date.now() - lastCheckTime > 2000)}`);
|
||||||
|
}
|
||||||
|
|
||||||
// Make sure it doesn't get double called with the play event
|
// Make sure it doesn't get double called with the play event
|
||||||
if (Math.abs(lastCheckVideoTime - video.currentTime) > 0.3
|
if (Math.abs(lastCheckVideoTime - video.currentTime) > 0.3
|
||||||
|| (lastCheckVideoTime !== video.currentTime && Date.now() - lastCheckTime > 2000)) {
|
|| (lastCheckVideoTime !== video.currentTime && Date.now() - lastCheckTime > 2000)) {
|
||||||
@@ -726,9 +734,10 @@ function setupVideoListeners() {
|
|||||||
};
|
};
|
||||||
video.addEventListener('pause', () => paused());
|
video.addEventListener('pause', () => paused());
|
||||||
video.addEventListener('waiting', () => {
|
video.addEventListener('waiting', () => {
|
||||||
paused();
|
|
||||||
|
|
||||||
console.warn("[SB] Not skipping due to buffering");
|
console.warn("[SB] Not skipping due to buffering");
|
||||||
|
startedWaiting = true;
|
||||||
|
|
||||||
|
paused();
|
||||||
});
|
});
|
||||||
|
|
||||||
startSponsorSchedule();
|
startSponsorSchedule();
|
||||||
@@ -1125,7 +1134,7 @@ async function whitelistCheck() {
|
|||||||
?? document.querySelector("a.ytp-title-channel-logo") // YouTube Embed
|
?? document.querySelector("a.ytp-title-channel-logo") // YouTube Embed
|
||||||
?? document.querySelector(".channel-profile #channel-name")?.parentElement.parentElement // Invidious
|
?? document.querySelector(".channel-profile #channel-name")?.parentElement.parentElement // Invidious
|
||||||
?? document.querySelector("a.slim-owner-icon-and-title")) // Mobile YouTube
|
?? document.querySelector("a.slim-owner-icon-and-title")) // Mobile YouTube
|
||||||
?.getAttribute("href")?.match(/\/channel\/(UC[a-zA-Z0-9_-]{22})/)[1];
|
?.getAttribute("href")?.match(/\/channel\/(UC[a-zA-Z0-9_-]{22})/)?.[1];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await utils.wait(() => !!getChannelID(), 6000, 20);
|
await utils.wait(() => !!getChannelID(), 6000, 20);
|
||||||
|
|||||||
Reference in New Issue
Block a user