From 13bf75bea712b3da356608dbcb8906d576828d4f Mon Sep 17 00:00:00 2001
From: ValueOn AG
Date: Sun, 15 Feb 2026 16:37:47 +0100
Subject: [PATCH] fix: use Array.from for NodeListOf iteration (TS2488 build
fix)
Co-authored-by: Cursor
---
src/bot/captionsProcedure.ts | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/bot/captionsProcedure.ts b/src/bot/captionsProcedure.ts
index 2098202..a79b1f3 100644
--- a/src/bot/captionsProcedure.ts
+++ b/src/bot/captionsProcedure.ts
@@ -277,10 +277,12 @@ export class CaptionsProcedure {
const candidates = document.querySelectorAll(
'[role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"], button, li'
);
- for (const el of candidates) {
- const text = (el as HTMLElement).innerText?.toLowerCase() || '';
+ const elArray = Array.from(candidates);
+ for (let i = 0; i < elArray.length; i++) {
+ const el = elArray[i] as HTMLElement;
+ const text = el.innerText?.toLowerCase() || '';
if (keywords.some(kw => text.includes(kw))) {
- (el as HTMLElement).click();
+ el.click();
return text;
}
}