Advertisement
Guest User

Untitled

a guest
May 6th, 2018
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         4chan censorship replacer
  3. // @namespace    http://tampermonkey.net/
  4. // @version      0.1
  5. // @description  Replace censored words with uncensored version in the text inputs
  6. // @include      https://boards.4chan.org/*
  7. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
  8. // ==/UserScript==
  9.  
  10.  
  11. (function() {
  12.     'use strict';
  13.  
  14.     var wordsTriggeringMods = ['soy','Soy'];
  15.  
  16.     function contains(target, pattern){
  17.         var value = 0;
  18.         pattern.forEach(function(word){
  19.             value = value + target.includes(word);
  20.         });
  21.         return (value === 1);
  22.     }
  23.  
  24.     $(document).on("click", "#file-n-submit [type='submit']", function(e){
  25.         var content = $('[data-name="com"]');
  26.         if(contains(content.val(), wordsTriggeringMods)){
  27.             content.val(content.val().replace("soy", "so᠌y").replace("Soy", "So᠌y"));
  28.         }
  29.     });
  30.  
  31. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement