Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lotverp/ad-block-for-twitch
A simple script for Tampermonkey that remove ad from twitch and other sites.
https://github.com/lotverp/ad-block-for-twitch
ads remove tampermonkey tampermonkey-script twitch twitchads
Last synced: 16 days ago
JSON representation
A simple script for Tampermonkey that remove ad from twitch and other sites.
- Host: GitHub
- URL: https://github.com/lotverp/ad-block-for-twitch
- Owner: Lotverp
- Created: 2024-12-21T19:14:33.000Z (16 days ago)
- Default Branch: main
- Last Pushed: 2024-12-21T19:58:07.000Z (16 days ago)
- Last Synced: 2024-12-21T20:22:59.814Z (16 days ago)
- Topics: ads, remove, tampermonkey, tampermonkey-script, twitch, twitchads
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ad-block-for-twitch
A simple script for Tampermonkey that remove ads from Twitch and other sites.
# How to use it
1) Download Tampermokey extension for your browser ([Chrome](https://chromewebstore.google.com/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo), [Firefox](https://addons.mozilla.org/it/firefox/addon/tampermonkey/))
2) Press the button "Add a new script"
3) Copy and paste this script ⬇️
4) Save it and realod twitch page
5) Enjoy on it without ads
```
// ==UserScript==
// @name Nascondi Elementi su Twitch (Compatibile Firefox)
// @namespace http://tampermonkey.net/
// @version 1.1
// @description Nasconde un elemento specifico su Twitch (ad esempio un banner o una sezione) per scopi educativi
// @author Il tuo nome
// @match https://www.twitch.tv/*
// @grant none
// ==/UserScript==(function() {
'use strict';// Funzione per verificare che la pagina sia completamente caricata
const onPageLoad = (callback) => {
if (document.readyState === 'complete') {
callback();
} else {
window.addEventListener('load', callback);
}
};// Selettore CSS per individuare gli elementi (esempio generico)
const adSelector = '[class*="ad"]'; // Cerca elementi che contengono "ad" nel nome della classe// Funzione per nascondere gli elementi trovati
const hideAds = () => {
const ads = document.querySelectorAll(adSelector);
ads.forEach(ad => {
ad.style.display = 'none';
console.log('Elemento nascosto:', ad);
});
};// Avvia lo script quando la pagina è caricata
onPageLoad(() => {
// Esegui inizialmente
hideAds();// Controlla periodicamente per gestire contenuti dinamici
setInterval(hideAds, 1000);
});
})();```