Created
February 22, 2024 11:58
-
-
Save Viicos/4481769e837b99ec475dafde23620c07 to your computer and use it in GitHub Desktop.
Remove Github force push actions Tampermonkey
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Remove Github force push actions | |
// @namespace http://tampermonkey.net/ | |
// @version 2024-02-09 | |
// @description Remove Github force push actions | |
// @author You | |
// @match https://github.com/*/*/pull/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=github.com | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
const removeForcePushedEvents = () => { | |
[...document.getElementsByTagName('a')].filter(el => el.text === 'force-pushed').map(el => el.parentElement.parentElement.parentElement).forEach(el => el.remove()); | |
} | |
// Watch on Github dynamic reloads: | |
const observer = new MutationObserver(removeForcePushedEvents); | |
observer.observe(document.documentElement, { attributes: true, childList: true, subtree: true }); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment