-
Notifications
You must be signed in to change notification settings - Fork 6
/
propernames.user.js
77 lines (66 loc) · 2.45 KB
/
propernames.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// ==UserScript==
// @name Proper user names
// @namespace http://jew.dance/
// @version 0.4
// @description Properly name users
// @author RealDolos
// @match https://volafile.io/r/*
// @grant none
// @run-at document-start
// ==/UserScript==
"use strict";
const replacements = [
[/mercwmouth/gi, "NiggerOnly4Penis"],
[/deadpool/gi, "PanSexFaggot"],
[/mcgill/gi, "SuperMarky"],
[/\bcounselor\b/gi, "CounselorPedro"],
[/\bLewdBot\b/gi, "Dungmaster"],
[/\b(?:system|news)\b/gi, "CucklordSupreme"]
];
console.log("running", GM_info.script.name, GM_info.script.version);
WebSocket = window.WebSocket = (function(ws) {
// I'd usually use a proxy, but thanks Chrome for not supporting ecma-6
const WebSocket = function(url, protocols) {
this.ws = new ws(url, protocols);
this.ws.onmessage = function(e) {
try {
let data = e.data;
for (let i of replacements) {
data = data.replace(i[0], i[1]);
}
if (data != e.data) {
e = new MessageEvent(e.type, {
data: data, origin: e.origin, lastEventId: e.lastEventId,
channel: e.channel, source: e.source, ports: e.ports});
}
}
catch (ex) {
console.error(e, ex);
}
return this.onmessage && this.onmessage(e);
}.bind(this);
};
WebSocket.prototype = {
get url() { return this.ws.url; },
CONNECTING: ws.CONNECTING,
OPEN: ws.OPEN,
CLOSING: ws.CLOSING,
CLOSED: ws.CLOSED,
get readyState() { return this.ws.readyState; },
get bufferedAmount() { return this.ws.ufferedAmount; },
get onopen() { return this.ws.onopen; },
set onopen(nv) { return this.ws.onopen = nv; },
get onerror() { return this.ws.onerror; },
set onerror(nv) { return this.ws.onerror = nv; },
get onclose() { return this.ws.onclose; },
set onclose(nv) { return this.ws.onclose = nv; },
get extensions() { return this.ws.extensions; },
get protocol() { return this.ws.protocol; },
close: function(code, reason) { this.ws.close(code || 1000, reason || ""); },
// onmessage handled in ctor
get binaryType() { return this.ws.binaryType; },
set binaryType(nv) { return this.ws.binaryType = nv; },
send: function(data) { this.ws.send(data); }
};
return WebSocket;
})(window.WebSocket);