User:Incongruence/chat.js/remove iframes.js

// Kills all elements in the chat on a new message. // TIME IN MILLISECONDS BETWEEN CHECKS const CHECK_TIME = 500; function IframeKiller { this.lastCount = 0; this.getMessages = function { var x = document.getElementsByClassName("Chat")[0]; return x.firstChild.getElementsByTagName("li").length; } this.kill = function { $("iframe").remove; } this.run = function { if(this.lastCount != this.getMessages) { this.kill; }   this.lastCount = this.getMessages; } } var killer = new IframeKiller; function imain { killer.run; } setInterval(imain, CHECK_TIME);