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

Function init

source/features/link-to-changelog-file.tsx:41–64  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39});
40
41async function init(): Promise<void | false> {
42 const changelog = await changelogName.get(getRepo()!.nameWithOwner);
43 if (!changelog) {
44 return false;
45 }
46
47 const releasesOrTagsNavbarSelector = [
48 'nav[aria-label^="Releases and Tags"]', // Release list
49 '.subnav-links', // Tag list
50 ];
51
52 const navbar = await elementReady(releasesOrTagsNavbarSelector);
53 navbar!.append(
54 tooltipped(
55 {label: `View the ${changelog} file`, direction: 'n'},
56 <a
57 className="subnav-item"
58 href={buildRepoUrl('blob', 'HEAD', changelog)}
59 >
60 <span>Changelog</span>
61 </a>,
62 ),
63 );
64}
65
66void features.add(import.meta.url, {
67 include: [

Callers

nothing calls this directly

Calls 4

tooltippedFunction · 0.85
buildRepoUrlFunction · 0.85
getMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected