Delete build.py
[Misc-UserScripts.git] / Kiwiirc-Annoyance-Removal.user.js
blobc246981ec5fe02922656ffcf4b370cfe70fd0054
1 // ==UserScript==
2 // @name         Kiwiirc Annoyance Removal
3 // @description remove user has joined prompts.
4 // @namespace    http://tampermonkey.net/
5 // @version      0.3
6 // @description  try to take over the world!
7 // @author       You
8 // @match        *://kiwiirc.com/client/irc.sageru.org/*
9 // @updateURL    https://github.com/ECHibiki/Misc-UserScripts/raw/master/Kiwiirc-Annoyance-Removal.user.js
10 // @downloadURL  https://github.com/ECHibiki/Misc-UserScripts/raw/master/Kiwiirc-Annoyance-Removal.user.js
11 // ==/UserScript==
13     console.log(document.body);
15 (function() {
16     function alterPage(){
17         var nodes = Array.from(document.body.getElementsByClassName('msg'));
18         //console.log("rdfg");
19         //console.log(nodes);
20         if(document.body.classList.contains('msg')){
21             nodes.unshift(document.body);
22         }
24         nodes.forEach(function(node){
25             var nodeList = node.childNodes;
26             if(nodeList[2].textContent.indexOf('_other_users is now known as') <= -1){
27                 //nodeList[1] = nodeList[0] + "::" +  nodeList[1];
28                 return;
29             }
30             else{
31                 node.remove();
32             }
33         });
34     }
36     //console.log(document.body);
38     new MutationObserver(function(mutations){
39         mutations.forEach(function(mutation){
40             mutation.addedNodes.forEach(alterPage);
41         });
42     }).observe(document.body, {childList: true, subtree: true});
43 })();