diff --git a/websites/G/GitHub/metadata.json b/websites/G/GitHub/metadata.json index c6489ef6f7f3..2460c2113b48 100644 --- a/websites/G/GitHub/metadata.json +++ b/websites/G/GitHub/metadata.json @@ -29,7 +29,7 @@ "github.com", "gist.github.com" ], - "version": "2.11.8", + "version": "2.11.9", "logo": "https://cdn.rcd.gg/PreMiD/websites/G/GitHub/assets/logo.png", "thumbnail": "https://cdn.rcd.gg/PreMiD/websites/G/GitHub/assets/thumbnail.png", "color": "#000000", diff --git a/websites/G/GitHub/presence.ts b/websites/G/GitHub/presence.ts index 45b6373313be..dc204c068d21 100644 --- a/websites/G/GitHub/presence.ts +++ b/websites/G/GitHub/presence.ts @@ -123,10 +123,18 @@ presence.on("UpdateData", async () => { delete presenceData.buttons; break; } + const pathFolder = document + .querySelector("#repos-header-breadcrumb-wide > ol") + ?.textContent.trim() + .split("/") + .slice(1) + .join("/"), + fileName = document.querySelector("#file-name-id-wide").textContent; presenceData.details = `Browsing repository ${repository.owner}/${repository.name}`; - presenceData.state = `Viewing file ${document - .querySelector("h2#blob-path > strong") - ?.textContent.trim()} at ${repository.target}`; + presenceData.state = `Viewing file ${(pathFolder + ? `${pathFolder}/${fileName}` + : fileName + )?.trim()} at ${repository.target}`; } else if (pathname.includes("/issues")) { if (pathname.includes("/issues/")) { if (pathname.includes("new")) {