mirror of
https://github.com/GetOpenScript/GitHub.openscript.git
synced 2026-09-18 08:25:42 +00:00
1.4 KiB
1.4 KiB
Display Repo Size for GitHub (OpenScript Userscript)
A lightweight OpenScript userscript that displays the total repository size directly on GitHub repository pages (for both public and private repositories).
Features
- Displays total repo size (formatted in KB, MB, or GB) next to the file navigation header.
- Works seamlessly on public and private repositories.
- Integrates with OpenScript's synced secrets: uses
GH_PAT(GitHub Personal Access Token) to authenticate API requests, unlock private repo access, and elevate the rate limit from 60 to 5,000 req/hr. - Supports GitHub's Turbo and SPA client-side navigations.
Installation in OpenScript
- Open the OpenScript extension popup.
- Click + New in the header.
- Copy and paste the code from
DisplayRepoSizeGitHub.user.jsinto the editor. - Click save script.
Private Repos & GitHub PAT Configuration
To view the size of private repositories:
- 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 with:
- Key:
GH_PAT - Value:
<your_personal_access_token>
- Key:
- Click + Add. The secret will sync across your devices via
chrome.storage.syncand will be automatically available to the script.