Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Tahribat uye gizleyici
// ==UserScript==
// @name Uyuzum bu elemana
// @match http*://*.tahribat.com/*
// @grant GM_notification
// @grant window.focus
// ==/UserScript==
var tanrininBelalari=["arabaci88","KaptaN","HolyOne","neverland"].map(function(a){return a.toLowerCase()}),posts=document.querySelectorAll("div.postPanel"),threads=document.querySelectorAll("#activeTopicsBig > tbody > tr"),notificationDetails={text:"{} denen murid artik senin kafani acamaz.",title:"{} gizlendi!",timeout:2900,onclick:function(){alert("Oynama tikim var.");window.focus()}};
0<posts.length&&posts.forEach(function(a){var c=a.querySelector("a").innerText.toLowerCase();if(tanrininBelalari.includes(c)){var b=Object.assign({},notificationDetails);b.text=notificationDetails.text.replace("{}",c);b.title=notificationDetails.title.replace("{}","Cevap");GM_notification(b);a.parentElement.parentElement.remove()}});
0<threads.length&&threads.forEach(function(a){var c=a.querySelector("td:nth-child(2) a").innerText.toLowerCase();if(tanrininBelalari.includes(c)){var b=Object.assign({},notificationDetails);b.text=notificationDetails.text.replace("{}",c);b.title=notificationDetails.title.replace("{}","Konu");GM_notification(b);a.remove()}});shim_GM_notification();
function shim_GM_notification(){"function"!==typeof GM_notification&&(window.GM_notification=function(a){function c(){"granted"===Notification.permission?b():"denied"===Notification.permission?alert("Tahribattan mesajlari ve konulari engellenen uyeler bildirimini almayi reddettiniz!"):Notification.requestPermission(function(d){console.log("New permission: ",d);c()})}function b(){if(a.title){a.text&&!a.body&&(a.body=a.text);var d=new Notification(a.title,a);a.onclick&&(d.onclick=a.onclick);a.timeout&&
setTimeout(function(){d.close()},a.timeout)}else console.log("Bildirim basligi yok")}c()})};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment