Greasy Fork is available in English.

Github Repository Tab Creator

Template Script to Create your own Repository Tab

Автор
Der_Floh
Инсталации дневно
0
Инсталации общо
1
Рейтинг
0 0 0
Версия
1.0.1
Създаден
16.06.2023
Обновен
15.09.2023
Лиценз
MIT
Работи на

This script is a template to create your own github repository tabs nice and simply. In the script is an example tab which does not work but provides the basic layout of how you can add your own 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;
});
  • If you want a working example comment out this code and remove the comment (/* and */) for the working example.
  • If you don't want to use a subpage feel free to add your own code into the event for the tab.

The working example is also used in the Github Stargazers Script

If there are suggestions for improvements, or you found a bug feel free to give me Feedback here