Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name BlabBlock v.1
- // @version 0.1
- // @description fuck the wurld
- // @author @paradoxal420
- // @match https://blab.im/*
- // @grant none
- // ==/UserScript==
- 'use strict';
- $(function() {
- if (!localStorage.blockList)
- {
- localStorage.blockList = JSON.stringify([]);
- }
- var ignoreUser = function(usr)
- {
- var newList = JSON.parse(localStorage.blockList);
- if (localStorage.blockList.indexOf(usr) == -1)
- {
- newList.push(usr);
- console.info(usr + ' - added to blocklist');
- localStorage.blockList = JSON.stringify(newList);
- }
- else
- {
- console.error('User Exists'); // Shouldn't be triggered anyways
- }
- }
- if (window.ignoreUser == undefined)
- {
- window.ignoreUser = ignoreUser;
- }
- function genIgnoreButton() {
- $('li.chat-message a.username span:last-child').css('font-size', '14px');
- if ($('li.chat-message a.username span:last-child'))
- {
- var users = $('li.chat-message a.username span:last-child')
- , index = 0;
- while (index < users.length - 1)
- {
- index++;
- if (users[index].parentElement.parentElement.innerHTML.substr(0, 5) != '<butt')
- {
- users[index].parentElement.parentElement.innerHTML = '<button onclick="ignoreUser(\'' + users[index].innerText + '\')" style="opacity:0.5;font-size: 8px;">I</button> ' + users[index].parentElement.parentElement.innerHTML;
- }
- }
- }
- }
- setInterval(genIgnoreButton, 200);
- function deleteMessages()
- {
- if (localStorage.blockList)
- {
- var usernames = JSON.parse(localStorage.blockList);
- for (var i = 0; i < usernames.length; i++)
- {
- $('span:contains("' + usernames[i] + '")').parent().parent().parent().parent().parent().remove();
- }
- }
- }
- setInterval(deleteMessages, 200);
- });
Advertisement
Add Comment
Please, Sign In to add comment