Greasy Fork

4chan egg puns

Wonder Egg Priority shitposting

目前为 2021-02-01 提交的版本。查看 最新版本

// ==UserScript==
// @name     4chan egg puns
// @description Wonder Egg Priority shitposting
// @version  2
// @grant    none
// @include *//boards.4chan.org/*
// @include *//boards.4channel.org/*
// @namespace https://greasyfork.org/users/141341
// ==/UserScript==
function process() {
  posts = document.getElementsByClassName('postMessage');
  for (var post of posts) {
    for (var i = 0; i < post.childNodes.length; ++i) {
      var node = post.childNodes[i];
      if (node.nodeName == '#text') {
        node.textContent = node.textContent
          .replaceAll('ex', 'eggs')
          .replaceAll('EX', 'EGGS')
          .replaceAll('Ex', 'Eggs')
        	.replaceAll(/eg(?!g)/g, 'egg')
        	.replaceAll(/EG(?!G)/g, 'EGG')
        	.replaceAll(/Eg(?!g)/g, 'Egg');
      }
    }
  }
}
process();
document.addEventListener('4chanXInitFinished', function(e) {
  process();
});
document.addEventListener('ThreadUpdate', function(e) {
  process();
});