SHOW:
|
|
- or go back to the newest paste.
1 | // ==UserScript== | |
2 | // @name blockinvites | |
3 | // @namespace ignoreinvites | |
4 | - | // @version 0.1 |
4 | + | // @version 0.21 |
5 | // @description blocks every free 50 $ group | |
6 | // @author /u/xpingu69 | |
7 | // @match http://steamcommunity.com/id/*/home/invites/ | |
8 | // @match http://steamcommunity.com/profiles/*/home/invites/ | |
9 | // @grant unsafeWindow | |
10 | //@require https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js | |
11 | // ==/UserScript== | |
12 | ||
13 | function reloadpage(){ | |
14 | ||
15 | location.reload(); | |
16 | } | |
17 | ||
18 | function ignoreinv(){ | |
19 | try { | |
20 | ||
21 | 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] | |
22 | var idvongruppe = $('[id^="invite__g"]').prop('id'); | |
23 | - | if (x.innerHTML.indexOf("FREE", "10$", "50$", "CASE") != -1) |
23 | + | |
24 | var x = document.getElementById(idvongruppe); | |
25 | - | { |
25 | + | |
26 | ||
27 | for (i=0;i<blacklist.length;i++) { | |
28 | if (x.innerHTML.indexOf(blacklist[i]) != -1) { | |
29 | ||
30 | ||
31 | - | |
31 | + | |
32 | if (commandtoignore.includes('ignore')) | |
33 | { | |
34 | eval(commandtoignore); | |
35 | location.href = x.getElementsByTagName('a')[1].getAttribute('href'); | |
36 | setTimeout(reloadpage, 1000); | |
37 | - | } |
37 | + | |
38 | } | |
39 | else | |
40 | console.log('nothing found'); | |
41 | setTimeout(reloadpage, 1000); | |
42 | } | |
43 | ||
44 | console.log('no free 50$ groups found'); | |
45 | setTimeout(reloadpage, 1000); | |
46 | ||
47 | } | |
48 | catch (err) { | |
49 | ||
50 | setTimeout(reloadpage, 1000); | |
51 | } | |
52 | ||
53 | } | |
54 | setTimeout(ignoreinv, 30000); |