fix: use Array.from for NodeListOf iteration (TS2488 build fix)
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
ba8dab5a98
commit
13bf75bea7
1 changed files with 5 additions and 3 deletions
|
|
@ -277,10 +277,12 @@ export class CaptionsProcedure {
|
||||||
const candidates = document.querySelectorAll(
|
const candidates = document.querySelectorAll(
|
||||||
'[role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"], button, li'
|
'[role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"], button, li'
|
||||||
);
|
);
|
||||||
for (const el of candidates) {
|
const elArray = Array.from(candidates);
|
||||||
const text = (el as HTMLElement).innerText?.toLowerCase() || '';
|
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))) {
|
if (keywords.some(kw => text.includes(kw))) {
|
||||||
(el as HTMLElement).click();
|
el.click();
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue