mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-08 04:27:15 +03:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b858971b66 | ||
|
|
383fe59bc0 | ||
|
|
27fe2ca8f0 | ||
|
|
54b4681fc3 |
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "__MSG_fullName__",
|
"name": "__MSG_fullName__",
|
||||||
"short_name": "SponsorBlock",
|
"short_name": "SponsorBlock",
|
||||||
"version": "2.0.12.2",
|
"version": "2.0.12.4",
|
||||||
"default_locale": "en",
|
"default_locale": "en",
|
||||||
"description": "__MSG_Description__",
|
"description": "__MSG_Description__",
|
||||||
"content_scripts": [{
|
"content_scripts": [{
|
||||||
|
|||||||
@@ -647,12 +647,12 @@ async function sponsorsLookup(id: string) {
|
|||||||
sponsorLookupRetries = 0;
|
sponsorLookupRetries = 0;
|
||||||
} else if (response?.status === 404) {
|
} else if (response?.status === 404) {
|
||||||
retryFetch(id);
|
retryFetch(id);
|
||||||
} else if (sponsorLookupRetries < 90 && !recheckStarted) {
|
} else if (sponsorLookupRetries < 15 && !recheckStarted) {
|
||||||
recheckStarted = true;
|
recheckStarted = true;
|
||||||
|
|
||||||
//TODO lower when server becomes better (back to 1 second)
|
//TODO lower when server becomes better (back to 1 second)
|
||||||
//some error occurred, try again in a second
|
//some error occurred, try again in a second
|
||||||
setTimeout(() => sponsorsLookup(id), 5000 + Math.random() * 15000);
|
setTimeout(() => sponsorsLookup(id), 5000 + Math.random() * 15000 + 5000 * sponsorLookupRetries);
|
||||||
|
|
||||||
sponsorLookupRetries++;
|
sponsorLookupRetries++;
|
||||||
}
|
}
|
||||||
@@ -1528,7 +1528,8 @@ function getSegmentsMessage(sponsorTimes: SponsorTime[]): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function addHotkeyListener(): boolean {
|
function addHotkeyListener(): boolean {
|
||||||
const videoRoot = document.getElementById("movie_player") as HTMLDivElement;
|
let videoRoot = document.getElementById("movie_player") as HTMLDivElement;
|
||||||
|
if (onInvidious) videoRoot = document.getElementById("player-container") as HTMLDivElement;
|
||||||
|
|
||||||
if (!videoRootsWithEventListeners.includes(videoRoot)) {
|
if (!videoRootsWithEventListeners.includes(videoRoot)) {
|
||||||
videoRoot.addEventListener("keydown", hotkeyListener);
|
videoRoot.addEventListener("keydown", hotkeyListener);
|
||||||
|
|||||||
Reference in New Issue
Block a user