Skip to content

Instantly share code, notes, and snippets.

@skyghis
Last active May 21, 2024 07:26
Show Gist options
  • Save skyghis/28558a62192e10538f262f5775cb24ed to your computer and use it in GitHub Desktop.
Save skyghis/28558a62192e10538f262f5775cb24ed to your computer and use it in GitHub Desktop.
Remove YggTorrent donation popup
// ==UserScript==
// @name Ygg remove donation popup and button
// @version 1.7.1
// @description Remove YggTorrent donation popup
// @namespace https://gist.github.com/skyghis/28558a62192e10538f262f5775cb24ed
// @updateURL https://gist.github.com/skyghis/28558a62192e10538f262f5775cb24ed/raw
// @match https://*ygg.*/*
// @icon https://www.ygg.re/favicon.ico
// @author SkyghiS
// @homepageURL https://gist.github.com/skyghis/28558a62192e10538f262f5775cb24ed
// @run-at document-idle
// ==/UserScript==
function removeElement(el, reSelector) {
//console.log("el=", el);
let e = document.querySelector(el);
//console.log("e=", e);
if (e && reSelector) {
e = reSelector(e);
}
if (e instanceof HTMLElement) {
e.remove();
} else {
//console.log("not found", el);
}
}
// Remove donate button at right of search bar
removeElement("a.donate.pulse");
// Left sidebar "Regarder la TV + freeleech"
removeElement("#cat li.misc");
// Top tab "Regarder la TV"
removeElement("#top nav li a[href='https://terraiptv.com/']", e => e.parentElement);
// Remove promo popup
[...document.querySelectorAll("div.promo-close")]
.filter(popup => popup && popup.style.display !== "none")
.forEach(popup => popup.click());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment