mirror of
https://github.com/GetOpenScript/GitHub.openscript.git
synced 2026-09-18 08:25:42 +00:00
c17b6c2dd23f82cdc55b2fb455f600d7f96f208e
Display Repo Size for GitHub (OpenScript Userscript)
A lightweight OpenScript userscript that displays the total repository size directly in the About section on GitHub repository pages (for both public and private repositories).
Features
- Integrated in About Section: Injects cleanly under repository details in the right sidebar (e.g.
📦 673.9 KB repo size). - Accurate Size Detection: Automatically detects when GitHub's API returns
0 KBon newly created repositories and falls back to calculating the total content size via the Git Trees API. - Private & Public Repositories: Works on public repositories out-of-the-box and uses
GH_PATfrom OpenScript secrets for private repositories. - Turbo / SPA Compatible: Seamlessly persists across GitHub's Turbo and client-side page transitions.
Installation in OpenScript
- Open the OpenScript extension popup.
- Click + New in the header.
- Paste the contents of
DisplayRepoSizeGitHub.user.js. - Click save script.
GitHub PAT Configuration (for Private Repos)
- Generate a GitHub Personal Access Token (
reposcope for private repos) at github.com/settings/tokens. - Open OpenScript and switch to the Secrets tab.
- Add a secret:
- Key:
GH_PAT - Value:
<your_token>
- Key:
- Click + Add. OpenScript synchronizes the secret via
chrome.storage.syncand securely provides it to your script asOpenScript.env.GH_PAT.
Description
Languages
JavaScript
100%