GitHub Hide Own Feed Meta

A userscript that hides your own repo metadata in the GitHub feed

2024-02-17 या दिनांकाला. सर्वात नवीन आवृत्ती पाहा.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

You will need to install an extension such as Tampermonkey to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name        GitHub Hide Own Feed Meta
// @version     0.1.9
// @description A userscript that hides your own repo metadata in the GitHub feed
// @license     MIT
// @author      Rob Garrison
// @namespace   https://github.com/Mottie
// @match       https://github.com/
// @run-at      document-idle
// @grant       none
// @require     https://greatest.deepsurf.us/scripts/28721-mutations/code/mutations.js?version=1108163
// @icon        https://github.githubassets.com/pinned-octocat.svg
// @supportURL  https://github.com/Mottie/GitHub-userscripts/issues
// ==/UserScript==

(() => {
	"use strict";

	const feedClass = ".watch_started"; // starred; not sure about watch event
	// Set up user string as "/{user}/" to match the link's href
	const user = `/${document.querySelector('meta[name="user-login"]').getAttribute("content")}/`;

	function init() {
		if (document.getElementById("dashboard")) {
			[...document.querySelectorAll(feedClass)].forEach(el => {
				// This is really fragile
				// div.border.rounded-1.p-3.my-2
				//  > div (no class)
				//   > span.f3.lh-condensed.text-bold.text-gray-dark
				//    > a.link-gray-dark.text-bold.wb-break-all[data-ga-click]
				const link = el.querySelector("div.border a[data-ga-click]");
				if (link.href.indexOf(user) > 0) {
					link.closest("div.border").style.display = "none";
				}
			});
			// ghmo observer isn't set up to watch the feed... we'll work around it for now
			document.querySelector(".ajax-pagination-btn").addEventListener("click", () => {
				setTimeout(() => {
					init();
				}, 1500);
			});
		}
	}

	document.addEventListener("ghmo:container", init);
	init();
})();