Github Repository Tab Creator

Template Script to Create your own Repository Tab

Penulis
Der_Floh
Pemasangan harian
0
Total pemasangan
1
Nilai
0 0 0
Versi
1.0.1
Dibuat
16 Juni 2023
Diperbarui
15 September 2023
Lisensi
MIT
Berlaku untuk

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