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

Function scrollTargetIntoView

source/options.tsx:181–202  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

179}
180
181function scrollTargetIntoView(): void {
182 const {hash} = location;
183 if (!hash) {
184 return;
185 }
186
187 const element = $optional(hash);
188 if (!element) {
189 return;
190 }
191
192 const details = closestElementOptional('details', element);
193 if (details) {
194 details.open = true;
195 }
196
197 element.scrollIntoView({
198 block: 'start',
199 });
200
201 hasScrolledToTarget = true;
202}
203
204async function init(): Promise<void> {
205 await generateDom();

Callers 1

initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected