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;
case "getChannelID":
sendResponse({
channelID: getChannelIDInfo().id
channelID: getChannelIDInfo().id,
isYTTV: (document.location.host === "tv.youtube.com")
});
break;

View File

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

View File

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