MCPcopy Index your code
hub / github.com/refined-github/refined-github / onButtonClick

Function onButtonClick

source/features/open-all-conversations.tsx:11–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9import observe from '../helpers/selector-observer.js';
10
11function 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
38function add(anchor: HTMLElement): void {
39 const isLegacy = closestElementOptional('.table-list-header-toggle', anchor);

Callers

nothing calls this directly

Calls 1

openTabsFunction · 0.85

Tested by

no test coverage detected