For more detailed information, please refer to the source code. It contains explanations and insights that may not be covered here.
- First, we need to listen for
DOMContentLoadedandturbo:loadevents 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-fragmentelements. 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-fragmentwith documentation. We can learn from the documentation that ainclude-fragmentelement will dispatch ainclude-fragment-replaceevent, just after the content has been fetched and parsed, and before it's inserted into the DOM. Better still, it comes with a handydetail.fragmentproperty of typeDocumentFragment, which is the parsed content. - So, for each
include-fragmentelement, we listen for theinclude-fragment-replaceevent and then process thedetail.fragmentto 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 clearing these tags' content property, we can prevent some tracking. Also, GitHub patches fetch to also send analytics data, so we need to revert this patch as well.
associations.json&icons.json: Extracted fromcatppuccin-web-file-explorer-icons-{version}-sources.zip.palette.json: Extracted and simplified frompalette.jsonin the Catppuccin palette.
$$("[class^='ListItem-module__listItem']").forEach(e => console.log(e.__reactProps$8h4h1f32xkn.children[3].props.children.props.deferredData.signatureInformation))
// Note that the string after __reactProps$ may vary- Input Element:
$("qbsearch-input")- Events:
qbsearch-input:closeqbsearch-input:expandqbsearch-input:updateText
- Properties:
astlastParsedQueryparserparsingsearchqueryBuilderretract
- Listens to
queryBuilder.parentElement'ssubmitevent
- Events:
- Query Builder:
$("qbsearch-input").queryBuilder- Events:
blackbird-monolith.manageCustomScopesblackbird-monolith.searchconvert-to-query-syntaxqueryquery-builder:navigatesearch-copilot-chat
- Properties:
attachProviderconst provider = {}; // TODO qb.addEventListener("query-builder:request-provider", e => { qb.attachProvider(provider); }, {once: true}); await qb.requestProviders();
- Events:
document.addEventListener("soft-nav:start", console.log);
navigation.addEventListener("navigate", console.log);
document.addEventListener("soft-nav:end", console.log);if (config.get("appearance.catppuccinIcons")) {
const HOOK_POINT = "webpackChunk_github_ui_github_ui";
const CHUNK_NAME = "46358"; // Content of the first array
const MODULE_ID = 59663; // The module ID that contains the target function
const chunks = [];
unsafeWindow[HOOK_POINT] = chunks;
const originalPush = Array.prototype.push;
chunks.push = function (...args) {
// Check if the chunk contains the target module
for (const chunk of args) {
console.log("Push chunk:", chunk[0][0]);
if (chunk[0][0] === CHUNK_NAME) {
console.log("Found target chunk:", chunk);
// Patch the target module
chunk[1][MODULE_ID] = patchedFunction;
// TODO: Revert the patch after use
// chunks.push = originalPush;
break;
}
}
return originalPush.apply(this, args);
};
function patchedFunction(exports, module, require) {
// todo
}
}site_admin: Sampletruefor jonmagicnode_id: Seems to be a base64-encoded string. For example, for jonmagic, thenode_idisMDQ6VXNlcjYyMw==, which can be decoded to04:User623.type: For normal users, it'sUser. IsUserfor actions-user, butOrganizationfor dependabot.public_repos,public_gistsgravatar_idevents_url,received_events_url
const crumbs = $("react-partial[partial-name='global-nav-bar']")?.embeddedDataJSON?.props?.contextRegion?.crumbs;window.a; // class ClientDefinedProviderElement, used in command palette