Greasy Fork is available in English.

Github Repository Tab Creator

Template Script to Create your own Repository Tab

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください。
作者
Der_Floh
1日のインストール数
0
累計インストール数
1
評価
0 0 0
バージョン
1.0.1
作成日
2023/06/16
更新日
2023/09/15
ライセンス
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