(el, match)
| 380 | } |
| 381 | |
| 382 | function getTextNode(el, match) { |
| 383 | const walk = document.createTreeWalker(el, NodeFilter.SHOW_TEXT, null, false); |
| 384 | if (!match) { |
| 385 | return walk.nextNode(); |
| 386 | } |
| 387 | |
| 388 | let node; |
| 389 | while ((node = walk.nextNode())) { |
| 390 | if (node.wholeText.includes(match)) { |
| 391 | return node; |
| 392 | } |
| 393 | } |
| 394 | } |
| 395 | |
| 396 | function setBaseAndExtent(...args) { |
| 397 | const document = args[0].ownerDocument; |