(page, exclusions = READABILITY_EXCLUSIONS)
| 656 | * Zustand darueber fuehrt. |
| 657 | */ |
| 658 | export async function resetScroll(page, exclusions = READABILITY_EXCLUSIONS) { |
| 659 | await page.evaluate((selectors) => { |
| 660 | const excluded = (node) => selectors.some((selector) => node.closest(selector) !== null); |
| 661 | for (const node of document.body.querySelectorAll('*')) { |
| 662 | if (excluded(node)) { |
| 663 | continue; |
| 664 | } |
| 665 | if (node.scrollTop !== 0) { |
| 666 | node.scrollTop = 0; |
| 667 | } |
| 668 | if (node.scrollLeft !== 0) { |
| 669 | node.scrollLeft = 0; |
| 670 | } |
| 671 | } |
| 672 | }, exclusions.map((entry) => entry.selector)); |
| 673 | } |
| 674 | |
| 675 | // ---------------------------------------------------------------- (e) Tooltips |
| 676 |
no test coverage detected