Skip to content

Instantly share code, notes, and snippets.

@Viicos
Created February 22, 2024 11:58
Show Gist options
  • Save Viicos/4481769e837b99ec475dafde23620c07 to your computer and use it in GitHub Desktop.
Save Viicos/4481769e837b99ec475dafde23620c07 to your computer and use it in GitHub Desktop.
Remove Github force push actions Tampermonkey
// ==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