()
| 9 | import observe from '../helpers/selector-observer.js'; |
| 10 | |
| 11 | function onButtonClick(): void { |
| 12 | const links = $$([ |
| 13 | 'a[data-testid="issue-pr-title-link"]', |
| 14 | // TODO [2026-01-01]: Pre-React selector; Drop |
| 15 | 'a.h4.js-navigation-open', |
| 16 | ]); |
| 17 | |
| 18 | if (links.length > 25) { |
| 19 | console.warn('Selected too many links. Is the selector still correct?'); |
| 20 | } |
| 21 | |
| 22 | const selectedLinks = links.filter(link => |
| 23 | closestElementOptional([ |
| 24 | // TODO [2026-01-01]: Pre-React selector; Drop |
| 25 | '.js-issue-row.selected', |
| 26 | '[aria-label^="Selected"]', |
| 27 | ], link), |
| 28 | ); |
| 29 | |
| 30 | const linksToOpen = selectedLinks.length > 0 |
| 31 | ? selectedLinks |
| 32 | : links; |
| 33 | |
| 34 | const urls = linksToOpen.map(link => link.href); |
| 35 | void openTabs(urls); |
| 36 | } |
| 37 | |
| 38 | function add(anchor: HTMLElement): void { |
| 39 | const isLegacy = closestElementOptional('.table-list-header-toggle', anchor); |
nothing calls this directly
no test coverage detected