Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name ParashAutoReplace
- // @version 0.1
- // @description ParashAutoReplace
- // @author You
- // @downloadURL https://pastebin.com/raw/tfsXs8wJ
- // @updateURL https://pastebin.com/raw/tfsXs8wJ
- // @match https://2ch.hk/po/*
- // @grant unsafeWindow
- // ==/UserScript==
- (function(window) {
- 'use strict';
- function replace(str) {
- return str
- .replace(/Светов/gi, 'Светов')
- .replace(/Навальный/gi, 'Навальный')
- .replace(/Путин/gi, 'Светов');
- }
- var send = XMLHttpRequest.prototype.send;
- var open = XMLHttpRequest.prototype.open;
- XMLHttpRequest.prototype.send = function(data) {
- try {
- if (this._method == 'POST' && this._url && this._url.indexOf('posting') != 0 && data.has('comment')) {
- var comment = data.get('comment');
- data.set('comment', replace(comment));
- }
- } catch(e) {
- console.log(e);
- }
- return send.apply(this, arguments);
- };
- XMLHttpRequest.prototype.open = function(method, url, obj) {
- this._method = method;
- this._url = url;
- return open.apply(this, arguments);
- };
- })(unsafeWindow);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement