(el, match)
| 350 | } |
| 351 | |
| 352 | function getTextNode(el, match) { |
| 353 | const walk = document.createTreeWalker(el, NodeFilter.SHOW_TEXT, null, false); |
| 354 | if (!match) { |
| 355 | return walk.nextNode(); |
| 356 | } |
| 357 | |
| 358 | let node; |
| 359 | while ((node = walk.nextNode())) { |
| 360 | if (node.wholeText.includes(match)) { |
| 361 | return node; |
| 362 | } |
| 363 | } |
| 364 | } |
| 365 | |
| 366 | function setBaseAndExtent(...args) { |
| 367 | const document = args[0].ownerDocument; |