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

Function getElementByAriaLabelledBy

source/helpers/dom-utils.ts:114–124  ·  view source on GitHub ↗
(baseSelector: string, label: string)

Source from the content-addressed store, hash-verified

112}
113
114export function getElementByAriaLabelledBy<T extends HTMLElement>(baseSelector: string, label: string): T {
115 for (const element of $$(baseSelector + '[aria-labelledby]')) {
116 const labelElement = $optional(`[id="${element.getAttribute('aria-labelledby')!}"]`);
117
118 if (labelElement?.textContent?.trim() === label) {
119 return element as T;
120 }
121 }
122
123 throw new ElementNotFoundError(`Expected element labelled "${label}" not found in: ${baseSelector}`);
124}
125
126export function getClasses(element: Element): Set<string> {
127 const list = new Set<string>();

Callers 1

setVersionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected