есть такой интересный сайт http://rusdtp.ru/
недавно на нём плюсом к форуму добавился какой-то непонятный и ненужный чатик, который занимает хренову тучу места на странице.
меня такой поворот событий возмутил, и сподвиг на написание юзерскрипта для Greasemonkey (этот аддон есть для FF, Chrome и Opera).
собственно, если кому-то интересно, то скрипт такой:
// ==UserScript== // @name rusdtp.ru chat blocker // @namespace rusdtp-chat-blocker // @include http://rusdtp.ru/* // @version 1 // ==/UserScript== // Main function main() { var e = document.getElementsByClassName('borderwrap')[0]; var child_div = e.children[0]; var child_script = e.children[1]; var child_frame = e.children[2]; if (child_div.nodeName == 'DIV' && child_script.nodeName == 'SCRIPT' && child_frame.nodeName == 'IFRAME') { var child_br = e.children[3]; e.removeChild(child_div); e.removeChild(child_script); e.removeChild(child_frame); if (child_br.nodeName == 'BR') e.removeChild(child_br); } } /** * Opera reads user.js files as greasemonkey notation with the following results: * - "Not permitted to use window.opera.addEventListener." Alternate addEvenetListener supported, but with wonky syntax * - DOES NOT WORK: addEventListener('DOMContentLoaded', main, false) * - WORKS: addEventListener('DOMContentLoaded', main(), false) * - Always runs after creating the DOM for the page; does not support // @run-at document-start * Opera reads .js files (NOT ending in user.js) as default with the following results: * - Allows use of window.opera.addEventListener * - WORKS: addEventListener('DOMContentLoaded', main, false) * - DOES NOT WORK: addEventListener('DOMContentLoaded', main(), false) * - "It is usually run before the DOM for the page has been completed," so // @run-at document-start is redundant * - Need to attach main() to an event listener, because DOM may not be ready when script is loaded. * More info: * - http://www.opera.com/docs/userjs/using/ (Adding User JavaScripts) * - http://www.opera.com/docs/userjs/examples/ (Greasemonkey scripts) */ if (window.opera) { // Opera's greasemonkey version of addEventListener() breaks try-catch on error, so it must be called first. try { document.addEventListener('DOMContentLoaded', main(), false) } catch(err) { document.addEventListener('DOMContentLoaded', main, false) } } else { // FF, Chrome document.addEventListener('DOMContentLoaded', main, false); }