(node)
| 226 | }; |
| 227 | |
| 228 | const ownText = (node) => { |
| 229 | let text = ''; |
| 230 | for (const child of node.childNodes) { |
| 231 | if (child.nodeType === Node.TEXT_NODE) { |
| 232 | text += child.nodeValue ?? ''; |
| 233 | } |
| 234 | } |
| 235 | return text.replace(/\s+/g, ' ').trim(); |
| 236 | }; |
| 237 | |
| 238 | const viewport = { width: window.innerWidth, height: window.innerHeight }; |
| 239 | const candidates = []; |