diff --git a/public/_locales/en/messages.json b/public/_locales/en/messages.json index f58eefb4..df9cdb57 100644 --- a/public/_locales/en/messages.json +++ b/public/_locales/en/messages.json @@ -410,15 +410,6 @@ "areYouSureReset": { "message": "Are you sure you would like to reset this?" }, - "confirmPrivacy": { - "message": "The video has been detected as unlisted. Click cancel if you do not want to check for skip segments." - }, - "unlistedCheck": { - "message": "Ignore Unlisted/Private Videos" - }, - "whatUnlistedCheck": { - "message": "This setting will slightly slow down SponsorBlock. Skip segment lookups require sending the video ID to the server. If you are concerned about unlisted video IDs being sent over the internet, enable this option." - }, "mobileUpdateInfo": { "message": "m.youtube.com is now supported" }, @@ -609,9 +600,6 @@ "permissionRequestFailed": { "message": "Permission request failed, did you click deny?" }, - "adblockerIssueUnlistedVideosInfo": { - "message": "If you are unable to resolve this, then disable the setting 'Ignore unlisted/private videos', as SponsorBlock is unable to retrieve the visibility information for this video" - }, "adblockerIssueWhitelist": { "message": "If you are unable to resolve this, then disable the setting 'Force Channel Check Before Skipping', as SponsorBlock is unable to retrieve the channel information for this video" }, diff --git a/public/options/options.html b/public/options/options.html index 5907c07b..05a6e911 100644 --- a/public/options/options.html +++ b/public/options/options.html @@ -343,23 +343,6 @@

-
- - -
-
- -
__MSG_whatUnlistedCheck__
-
- -
-
-
__MSG_changeUserID__ diff --git a/src/content.ts b/src/content.ts index 1092121e..9270977a 100644 --- a/src/content.ts +++ b/src/content.ts @@ -253,29 +253,25 @@ async function videoIDChange(id) { // Wait for options to be ready await utils.wait(() => Config.config !== null, 5000, 1); - // Get new video info - getVideoInfo(); - // If enabled, it will check if this video is private or unlisted and double check with the user if the sponsors should be looked up if (Config.config.checkForUnlistedVideos) { - try { - await utils.wait(() => !!videoInfo, 5000, 1); - } catch (err) { - await videoInfoFetchFailed("adblockerIssueUnlistedVideosInfo"); - } - - if (isUnlisted()) { - const shouldContinue = confirm(chrome.i18n.getMessage("confirmPrivacy")); - if(!shouldContinue) return; + const shouldContinue = confirm("SponsorBlock: You have the setting 'Ignore Unlisted/Private Videos' enabled." + + " Due to a change in how segment fetching works, this setting is not needed anymore as it cannot leak your video ID to the server." + + " It instead sends just the first 4 characters of a longer hash of the videoID to the server, and filters through a subset of the database." + + " More info about this implementation can be found here: https://github.com/ajayyy/SponsorBlockServer/issues/25" + + "\n\nPlease click okay to confirm that you acknowledge this and continue using SponsorBlock."); + if (shouldContinue) { + Config.config.checkForUnlistedVideos = false; + } else { + return; } } + // Get new video info + getVideoInfo(); + // Update whitelist data when the video data is loaded - utils.wait(() => !!videoInfo, 5000, 10).then(whitelistCheck).catch(() => { - if (Config.config.forceChannelCheck) { - videoInfoFetchFailed("adblockerIssueWhitelist"); - } - }); + whitelistCheck(); //setup the preview bar if (previewBar === null) { @@ -833,8 +829,31 @@ function updatePreviewBar(): void { } //checks if this channel is whitelisted, should be done only after the channelID has been loaded -function whitelistCheck() { - channelID = videoInfo?.videoDetails?.channelId; +async function whitelistCheck() { + const whitelistedChannels = Config.config.whitelistedChannels; + + const getChannelID = () => videoInfo?.videoDetails?.channelId + ?? document.querySelector(".ytd-channel-name a")?.getAttribute("href")?.replace(/\/.+\//, "") // YouTube + ?? document.querySelector(".ytp-title-channel-logo")?.getAttribute("href")?.replace(/https:\/.+\//, "") // YouTube Embed + ?? document.querySelector("a > .channel-profile")?.parentElement?.getAttribute("href")?.replace(/\/.+\//, ""); // Invidious + + try { + await utils.wait(() => !!getChannelID(), 6000, 20); + } catch { + if (Config.config.forceChannelCheck) { + // treat as not whitelisted + channelID = ""; + + // Don't warn for Invidious embeds + if (!(onInvidious && document.URL.includes("/embed/"))) { + videoInfoFetchFailed("adblockerIssueWhitelist"); + } + } + + return; + } + + channelID = getChannelID(); if (!channelID) { channelID = null; @@ -842,8 +861,6 @@ function whitelistCheck() { } //see if this is a whitelisted channel - const whitelistedChannels = Config.config.whitelistedChannels; - if (whitelistedChannels != undefined && whitelistedChannels.includes(channelID)) { channelWhitelisted = true; }