(element, selector)
| 3438 | } |
| 3439 | |
| 3440 | function $XPath(element, selector) { |
| 3441 | const found = document.evaluate(selector, element || document.body, null, 5, null) |
| 3442 | const res = [] |
| 3443 | let current = null |
| 3444 | while ((current = found.iterateNext())) { |
| 3445 | res.push(current) |
| 3446 | } |
| 3447 | return res |
| 3448 | } |
| 3449 | |
| 3450 | async function targetCreatedHandler(page) { |
| 3451 | if (!page) return |