Tampermonkey userscript to remove "Filter by repository" link in compact issues view for individual repository on GitHub.
| // ==UserScript== | |
| // @name Remove filter-by-repo link | |
| // @namespace http://github.com/ | |
| // @version 2026-10-23 | |
| // @description remove annoyance | |
| // @author Cheatoid | |
| // @match https://github.com/*/*/issues* | |
| // @icon https://www.google.com/s2/favicons?sz=64&domain=github.com | |
| // @grant none | |
| // @run-at document-end | |
| // ==/UserScript== | |
| (function() { | |
| 'use strict'; | |
| function removeFilterButtons() { | |
| for (let butt of document.getElementsByTagName("button")) { | |
| if (butt.getAttribute("aria-label")?.startsWith("Filter by repository ")) { | |
| const parent = butt.parentElement.parentElement; | |
| parent.removeChild(parent.children[0]); | |
| parent.removeChild(parent.children[0]); | |
| } | |
| } | |
| } | |
| const observer = new MutationObserver(() => removeFilterButtons()); | |
| observer.observe(document.body, { childList: true, subtree: true }); | |
| // Initial run + re-run on GitHub's soft navigation | |
| removeFilterButtons(); | |
| document.addEventListener('turbo:load', removeFilterButtons); | |
| })(); |
参与讨论