mirror of
https://github.com/GetOpenScript/GitHub.openscript.git
synced 2026-09-18 08:25:42 +00:00
ed18934b8f6e1f614e0aeb841423dd02284f597c
Display Repo Size for GitHub (OpenScript Userscript)
A lightweight OpenScript userscript that displays the total repository size (including all commit history, branches, tags, and packfiles) directly in the About section on GitHub repository pages (for both public and private repositories).
Features
- Accurate Git History Size: Uses GitHub's native
repo.sizedisk usage measurement, accurately reflecting the full Git history, delta compression, and packfiles rather than loose blobs. - New Repo Handling: If a repository was just pushed and GitHub is still computing initial disk usage (
0 KB), it provides a friendly indicator (0 KB (calculating...)) until GitHub finishes indexing. - Integrated in About Section: Injects cleanly under repository details in the right sidebar.
- Private Repositories Supported: Uses
GH_PATfrom OpenScript secrets for private repositories and increased rate limits. - 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 (or click your existing script to edit).
- 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%