mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-09 04:57:09 +03:00
Merge branch 'master' of https://github.com/ajayyy/SponsorBlock into mv3
This commit is contained in:
@@ -76,6 +76,9 @@
|
|||||||
"https://*.youtube.com/*",
|
"https://*.youtube.com/*",
|
||||||
"https://www.youtube-nocookie.com/embed/*"
|
"https://www.youtube-nocookie.com/embed/*"
|
||||||
],
|
],
|
||||||
|
"exclude_matches": [
|
||||||
|
"https://accounts.youtube.com/RotateCookiesPage*"
|
||||||
|
],
|
||||||
"all_frames": true,
|
"all_frames": true,
|
||||||
"run_at": "document_start"
|
"run_at": "document_start"
|
||||||
},
|
},
|
||||||
@@ -92,6 +95,9 @@
|
|||||||
"https://*.youtube.com/*",
|
"https://*.youtube.com/*",
|
||||||
"https://www.youtube-nocookie.com/embed/*"
|
"https://www.youtube-nocookie.com/embed/*"
|
||||||
],
|
],
|
||||||
|
"exclude_matches": [
|
||||||
|
"https://accounts.youtube.com/RotateCookiesPage*"
|
||||||
|
],
|
||||||
"all_frames": true,
|
"all_frames": true,
|
||||||
"run_at": "document_start"
|
"run_at": "document_start"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,6 +120,9 @@
|
|||||||
"https://*.youtube.com/*",
|
"https://*.youtube.com/*",
|
||||||
"https://www.youtube-nocookie.com/embed/*"
|
"https://www.youtube-nocookie.com/embed/*"
|
||||||
],
|
],
|
||||||
|
"exclude_matches": [
|
||||||
|
"https://accounts.youtube.com/RotateCookiesPage*"
|
||||||
|
],
|
||||||
"all_frames": true,
|
"all_frames": true,
|
||||||
"js": [
|
"js": [
|
||||||
"./js/content.js"
|
"./js/content.js"
|
||||||
|
|||||||
@@ -264,7 +264,9 @@ function messageListener(request: Message, sender: unknown, sendResponse: (respo
|
|||||||
// it will assume the page is not a video page and stop the refresh animation
|
// it will assume the page is not a video page and stop the refresh animation
|
||||||
sendResponse({ hasVideo: getVideoID() != null });
|
sendResponse({ hasVideo: getVideoID() != null });
|
||||||
// fetch segments
|
// fetch segments
|
||||||
sponsorsLookup(false);
|
if (getVideoID()) {
|
||||||
|
sponsorsLookup(false);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "unskip":
|
case "unskip":
|
||||||
@@ -1115,7 +1117,12 @@ async function sponsorsLookup(keepOldSubmissions = true) {
|
|||||||
const hashParams = getHashParams();
|
const hashParams = getHashParams();
|
||||||
if (hashParams.requiredSegment) extraRequestData.requiredSegment = hashParams.requiredSegment;
|
if (hashParams.requiredSegment) extraRequestData.requiredSegment = hashParams.requiredSegment;
|
||||||
|
|
||||||
const hashPrefix = (await getHash(getVideoID(), 1)).slice(0, 4) as VideoID & HashedValue;
|
const videoID = getVideoID()
|
||||||
|
if (!videoID) {
|
||||||
|
console.error("[SponsorBlock] Attempted to fetch segments with a null/undefined videoID.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const hashPrefix = (await getHash(videoID, 1)).slice(0, 4) as VideoID & HashedValue;
|
||||||
const response = await asyncRequestToServer('GET', "/api/skipSegments/" + hashPrefix, {
|
const response = await asyncRequestToServer('GET', "/api/skipSegments/" + hashPrefix, {
|
||||||
categories,
|
categories,
|
||||||
actionTypes: getEnabledActionTypes(),
|
actionTypes: getEnabledActionTypes(),
|
||||||
|
|||||||
Reference in New Issue
Block a user