mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2026-01-31 23:01:07 +03:00
Refractor popup infoFound() empty message detection
This commit is contained in:
@@ -460,14 +460,13 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
|
||||
stopLoadingAnimation = null;
|
||||
}
|
||||
|
||||
if (chrome.runtime.lastError) {
|
||||
if (chrome.runtime.lastError || request == undefined || request.found == undefined) {
|
||||
//This page doesn't have the injected content script, or at least not yet
|
||||
// Or if the request is empty, meaning the current page is not YouTube or a video page
|
||||
displayNoVideo();
|
||||
return;
|
||||
}
|
||||
|
||||
// if request has no field other than message, then the page currently being browsed is not YouTube
|
||||
if (request.found != undefined) {
|
||||
//remove loading text
|
||||
PageElements.mainControls.style.display = "block";
|
||||
if (request.onMobileYouTube) PageElements.mainControls.classList.add("hidden");
|
||||
@@ -491,9 +490,6 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
|
||||
|
||||
PageElements.issueReporterImportExport.classList.remove("hidden");
|
||||
}
|
||||
} else {
|
||||
displayNoVideo();
|
||||
}
|
||||
|
||||
//see if whitelist button should be swapped
|
||||
const response = await sendTabMessageAsync({ message: 'isChannelWhitelisted' }) as IsChannelWhitelistedResponse;
|
||||
|
||||
Reference in New Issue
Block a user