Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name blockinvites
- // @namespace ignoreinvites
- // @version 0.21
- // @description blocks every free 50 $ group
- // @author /u/xpingu69
- // @match http://steamcommunity.com/id/*/home/invites/
- // @match http://steamcommunity.com/profiles/*/home/invites/
- // @grant unsafeWindow
- //@require https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js
- // ==/UserScript==
- function reloadpage(){
- location.reload();
- }
- function ignoreinv(){
- try {
- var blacklist = ["FREE", "10$", "50$", "CASE", "Free"]; //if you want to add more words, just add them according to the syntax: strings must be like this: "foo", ints like this: 1; split with a comma; example: ["foo", "bar", 50]
- var idvongruppe = $('[id^="invite__g"]').prop('id');
- var x = document.getElementById(idvongruppe);
- for (i=0;i<blacklist.length;i++) {
- if (x.innerHTML.indexOf(blacklist[i]) != -1) {
- var commandtoignore = x.getElementsByTagName('a')[1].getAttribute('href');
- if (commandtoignore.includes('ignore'))
- {
- eval(commandtoignore);
- location.href = x.getElementsByTagName('a')[1].getAttribute('href');
- setTimeout(reloadpage, 1000);
- }
- }
- else
- console.log('nothing found');
- setTimeout(reloadpage, 1000);
- }
- console.log('no free 50$ groups found');
- setTimeout(reloadpage, 1000);
- }
- catch (err) {
- setTimeout(reloadpage, 1000);
- }
- }
- setTimeout(ignoreinv, 30000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement