Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Remove year comments
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description remove the stupid "2018 anyone?" comments from youtube
- // @author gilm.isaac@gmail.com
- // @match https://www.youtube.com/*
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- var commentsToRemoveRegex = /[0-9k]{4}|\d{2}([^\d]\d{2}){2}|(0.25|0.5|1.25|2).*speed|january|february|march|april|may|june|july|august|september|october|november|december|i am from|anyone from|brazil/i; // fuck the brazilians too
- function KillWithFire() {
- var comments = document.querySelectorAll('ytd-comment-thread-renderer');
- Array.prototype.filter.call(comments, (item) => commentsToRemoveRegex.test(item.querySelector('yt-formatted-string#content-text').innerText.replace(/[^0-9a-zA-Z]/g,'')) ? item : null).forEach((item) => item.parentNode.removeChild(item));
- }
- setInterval(KillWithFire, 100)
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement