Skip to content

Instantly share code, notes, and snippets.

@Hypfer
Last active December 14, 2023 19:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hypfer/6f10fadbc1aacf540c39eadef7661bb3 to your computer and use it in GitHub Desktop.
Save Hypfer/6f10fadbc1aacf540c39eadef7661bb3 to your computer and use it in GitHub Desktop.
This userscript hides the nagging notification boxes that remind you that you've enabled interaction limits on a repo or account
// ==UserScript==
// @name Hide Github Interaction Limits Nagging Notifications
// @namespace Violentmonkey Scripts
// @match https://github.com/**
// @grant none
// @version 1.1
// @author -
// @description 23/12/2022, 14:51:33
// ==/UserScript==
let loopTimeout;
function loop() {
const alertElements = [
...document.querySelectorAll('.flash.mb-3'),
...document.querySelectorAll('[class^="Flash"]')
];
for (let i = 0; i < alertElements.length; i++) {
const alertElement = alertElements[i];
if(alertElement.textContent?.includes("interaction limit")) {
alertElement.remove()
}
}
if (document.visibilityState === 'visible') {
loopTimeout = setTimeout(() => {
loop()
}, 1000);
}
}
document.addEventListener("visibilitychange", () => {
if (document.visibilityState === 'visible') {
loop();
} else {
clearTimeout(loopTimeout);
}
});
loop();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment