If you encounter issues reading Greasy Fork's README, please visit the README on GitHub for a better experience.
- No use of
MutationObserver
orsetInterval
, purely event-driven, making it more efficient than scripts of similar functionality - No dangerous monkey patching, ensuring compatibility
- Experimental support for all GitHub mirrors
- You need to add the mirror site to this script's
User matches
list Dashboard
-Installed Userscripts
-GitHub Plus
-Settings
-Includes/Excludes
-User matches
-Add...
- You need to add the mirror site to this script's
- 🔢 Code Features
- 📥 Clone Full Command: Append
git clone
beforehttps
andgit@
URLs under the code tab. (Experimental, may or may not work) - ➡️ Tab Size: Set Tab indentation size.
- 😉 Cursor Blink: Enable cursor blinking.
- 🌊 Cursor Animation: Make cursor move smoothly.
- 📥 Clone Full Command: Append
- 🎨 Appearance
- 📰 Dashboard: Configures the dashboard (
Default
,Hide Copilot
,Hide Feed
,Mobile-Like
) ↖️ Left Sidebar: Configures the left sidebar (Default
,Hidden
)↗️ Right Sidebar: Configures the right sidebar (Default
,Hide 'Latest changes'
,Hide 'Explore repositories'
,Hide Completely
)
- 📰 Dashboard: Configures the dashboard (
- 📦 Release Features
- ⬆️ Release Uploader: Show uploader of release assets.
- Shows a user hover card on hover if the uploader is a user.
- Colored as green if the uploader is a GitHub App.
- 📥 Release Downloads: Show download counts of release assets.
- 📊 Release Histogram: Show a histogram of download counts for each release asset.
- Does not show up if there is only zero or one release asset.
- Does not show up if none of the release assets have been downloaded.
- ⬆️ Release Uploader: Show uploader of release assets.
- 🪄 Additional Features
- 🎭 Tracking Prevention: Prevents some tracking by GitHub.
- ⚙️ Advanced Settings
- 🔑 Personal Access Token: Your personal access token for GitHub API, starting with
github_pat_
(used for increasing rate limit). For more information, see the Personal Access Token (PAT) section. - 📈 Rate Limit: View the current rate limit status.
- 🐞 Debug: Enable debug mode.
- 🔑 Personal Access Token: Your personal access token for GitHub API, starting with
Example "Assets" section
Following example release "Assets" section has Release Downloads
, Release Uploader
and Release Histogram
enabled.
Example Dashboard
Example Dashboard, with 📰 Dashboard
set to Mobile-Like
, ↖️ Left Sidebar
set to Hidden
and ↗️ Right Sidebar
set to Hide 'Latest changes'
.
- Without a PAT, only
$60$ requests per hour are allowed; with a PAT,$5000$ requests per hour are allowed, which suffices for most users. - Find out how to create a fine-grained personal access token here.
- Simply select
Public Repositories (read-only)
underRepository access
tab, which is the default setup. An example image is shown below for reference. - Do note that this script won't be able to add additional information on private repositories.
- Remember to generate a new token when it expires.
- Use a personal access token on a mirror site at your own risk.
For more detailed information, please refer to the source code. It is (hopefully) well-commented and contains other explanations and insights that may not be covered here.
- First, we need to listen for
DOMContentLoaded
andturbo:load
events to know when DOM is ready or there has been a content change. In both cases, we need to re-check the page (setupListeners
). - Then, we should find all release-related
include-fragment
elements. By using devtools, we learn that they will be dynamically replaced with the actual content, so it's vital to investigate them. - Search GitHub and we can find the repo for
include-fragment
with documentation. We can learn from the documentation that ainclude-fragment
element will dispatch ainclude-fragment-replace
event, just after the content has been fetched and parsed, and before it's inserted into the DOM. Better still, it comes with a handydetail.fragment
property of typeDocumentFragment
, which is the parsed content. - So, for each
include-fragment
element, we listen for theinclude-fragment-replace
event and then process thedetail.fragment
to add our additional information (onFragmentReplace
). - In order to query additional information for a given release, we simply call the "Get a release by tag name" API. We can then extract the information we need and add it to the
DocumentFragment
.
By investigating source code (thanks for the source mapping) and setting breakpoints, we can find out that GitHub initializes tracking endpoints from certain <meta>
tags. By removing these tags, we can prevent some tracking. For more details, please refer to the source code, or read this thread (in Chinese).
- The added information might not align well.
- You might see a "Error Looks like something went wrong!" banner if "Tracking Prevention" is enabled.