Enhance GitHub with additional features.
If you encounter issues reading Greasy Fork's README, please visit the README on GitHub for a better experience.
MutationObserver or setInterval, purely event-driven, making it more efficient than scripts of similar functionalityUser matches listDashboard - Installed Userscripts - GitHub Plus - Settings - Includes/Excludes - User matches - Add...git clone before https and git@ URLs under the code tab. (Experimental, may or may not work)Default, Hide Copilot, Hide Feed, Mobile-Like)Default, Hidden)Default, Hide 'Latest changes', Hide 'Explore repositories', Hide Completely)github_pat_ (used for increasing rate limit). For more information, see the Personal Access Token (PAT) section.Public Repositories (read-only) under Repository access tab, which is the default setup. An example image is shown below for reference.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.
Release * FeaturesDOMContentLoaded and turbo: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).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.include-fragment with documentation. We can learn from the documentation that a include-fragment element will dispatch a include-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 handy detail.fragment property of type DocumentFragment, which is the parsed content.include-fragment element, we listen for the include-fragment-replace event and then process the detail.fragment to add our additional information (onFragmentReplace).DocumentFragment.Tracking Prevention FeatureBy 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 clearing these tags' content property, we can prevent some tracking. For more details, please refer to the source code, or read this thread (in Chinese).