mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-07 12:07:11 +03:00
Made it not error when a non YouTube page was open
This commit is contained in:
3
popup.js
3
popup.js
@@ -32,12 +32,15 @@ chrome.tabs.query({
|
|||||||
})
|
})
|
||||||
|
|
||||||
function infoFound(request) {
|
function infoFound(request) {
|
||||||
|
//if request is undefined, then the page currently being browsed is not YouTube
|
||||||
|
if (request != undefined) {
|
||||||
if (request.found) {
|
if (request.found) {
|
||||||
document.getElementById("videoFound").innerHTML = "This video's sponsors are in the database!"
|
document.getElementById("videoFound").innerHTML = "This video's sponsors are in the database!"
|
||||||
} else {
|
} else {
|
||||||
document.getElementById("videoFound").innerHTML = "No sponsors found"
|
document.getElementById("videoFound").innerHTML = "No sponsors found"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function sendSponsorStartMessage() {
|
function sendSponsorStartMessage() {
|
||||||
//the content script will get the message if a YouTube page is open
|
//the content script will get the message if a YouTube page is open
|
||||||
|
|||||||
Reference in New Issue
Block a user