Use a specific error message channel whitelisting on YTTV

This commit is contained in:
tech234a
2025-01-13 00:47:23 -05:00
parent de1d6bd76a
commit 138e57b720
4 changed files with 9 additions and 3 deletions

View File

@@ -240,7 +240,8 @@ function messageListener(request: Message, sender: unknown, sendResponse: (respo
break; break;
case "getChannelID": case "getChannelID":
sendResponse({ sendResponse({
channelID: getChannelIDInfo().id channelID: getChannelIDInfo().id,
isYTTV: (document.location.host === "tv.youtube.com")
}); });
break; break;

View File

@@ -86,6 +86,7 @@ interface GetVideoIdResponse {
export interface GetChannelIDResponse { export interface GetChannelIDResponse {
channelID: string; channelID: string;
isYTTV: boolean;
} }
export interface SponsorStartResponse { export interface SponsorStartResponse {

View File

@@ -917,7 +917,11 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
//get the channel url //get the channel url
const response = await sendTabMessageAsync({ message: 'getChannelID' }) as GetChannelIDResponse; const response = await sendTabMessageAsync({ message: 'getChannelID' }) as GetChannelIDResponse;
if (!response.channelID) { if (!response.channelID) {
if (response.isYTTV) {
alert(chrome.i18n.getMessage("yttvNoChannelWhitelist"));
} else {
alert(chrome.i18n.getMessage("channelDataNotFound") + " https://github.com/ajayyy/SponsorBlock/issues/753"); alert(chrome.i18n.getMessage("channelDataNotFound") + " https://github.com/ajayyy/SponsorBlock/issues/753");
}
return; return;
} }