fix(PageDetection): SEQTA.ts throwing errors on html pages with less than 2 document childNodes

This commit is contained in:
SethBurkart123
2024-10-05 20:22:39 +10:00
parent 818ff48a0d
commit 84eaecdadd
+4 -1
View File
@@ -46,10 +46,13 @@ let currentSelectedDate = new Date()
let LessonInterval: any let LessonInterval: any
var IsSEQTAPage = false var IsSEQTAPage = false
let hasSEQTAText = false
// This check is placed outside of the document load event due to issues with EP (https://github.com/BetterSEQTA/BetterSEQTA-Plus/issues/84) // This check is placed outside of the document load event due to issues with EP (https://github.com/BetterSEQTA/BetterSEQTA-Plus/issues/84)
const hasSEQTAText = document.childNodes[1].textContent?.includes('Copyright (c) SEQTA Software') if (document.childNodes[1]) {
hasSEQTAText = document.childNodes[1].textContent?.includes('Copyright (c) SEQTA Software') ?? false
init() init()
}
async function init() { async function init() {
CheckForMenuList() CheckForMenuList()