From bb3a4c095483d144a214539e44e942cbdef54346 Mon Sep 17 00:00:00 2001 From: bekucera Date: Fri, 10 May 2024 18:06:21 +0200 Subject: [PATCH] isset(sources) --- prehrajto.user.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/prehrajto.user.js b/prehrajto.user.js index 6e3bb03..05d88cd 100644 --- a/prehrajto.user.js +++ b/prehrajto.user.js @@ -9,9 +9,11 @@ // @description 5/10/2024, 10:46:53 AM // ==/UserScript== -h1 = document.getElementsByTagName("h1")[0]; -buttons = ""; -sources.videos.map((item) => { - buttons += `${item.res}p
`; -}); -h1.innerHTML = `${h1.innerHTML}
${buttons}`; \ No newline at end of file +if (typeof sources !== 'undefined') { + h1 = document.getElementsByTagName("h1")[0]; + buttons = ""; + sources.videos.map((item) => { + buttons += `${item.res}p
`; + }); + h1.innerHTML = `${h1.innerHTML}
${buttons}`; +} \ No newline at end of file