Template Script to Create your own Repository Tab
Please use this code in your own NEW Script, because if this gets updated your custom code might be overwritten.
This shows how you can add a tab:
const name = "EXAMPLE-NAME"; // <-- Name for the tab (has to be something)
const icon = "https://somewebsite/EXAMPLE-ICON.png"; // <-- icon to use for the tab (possible: image link, svg string, html element, empty for no icon)
createTabElem(name, icon, (event) => {
const currentLocation = window.location.toString();
const subpage = "EXAMPLE-SUBPAGE"; // <-- Subpage to navigate to (for example https://github.com/username/repositoryname/SUBPAGE)
const link = `/${getUsername(currentLocation)}/${getRepositoryname(currentLocation)}/${subpage}`;
window.location.href = link;
});
/* and */) for the working example.The working example is also used in the Github Stargazers Script