Made it not error when a non YouTube page was open

This commit is contained in:
Ajay Ramachandran 2019-07-09 12:07:39 -04:00
parent fc8257e491
commit 7c0b43ac69

View file

@ -32,10 +32,13 @@ chrome.tabs.query({
}) })
function infoFound(request) { function infoFound(request) {
if (request.found) { //if request is undefined, then the page currently being browsed is not YouTube
document.getElementById("videoFound").innerHTML = "This video's sponsors are in the database!" if (request != undefined) {
} else { if (request.found) {
document.getElementById("videoFound").innerHTML = "No sponsors found" document.getElementById("videoFound").innerHTML = "This video's sponsors are in the database!"
} else {
document.getElementById("videoFound").innerHTML = "No sponsors found"
}
} }
} }