// ==UserScript== | |
// @name Fuck corps | |
// @namespace https://i544c.github.io | |
// @match *://*/* | |
// @grant GM_getValue | |
// @version 1.1.2 | |
// @author i544c | |
// @description クソ企業ばかり | |
// ==/UserScript== | |
(() => { | |
'use strict'; | |
const shitty_corps = GM_getValue('shitty_corps', []); | |
const shitty_word = GM_getValue('shitty_word', 'クソ企業'); | |
const shit_regex = new RegExp(`(${shitty_corps.join('|')})`, 'ig'); | |
const replacer = el => { | |
el.childNodes.forEach(child_el => { | |
if (child_el.childNodes.length > 0) { | |
replacer(child_el); | |
return; | |
} | |
if (child_el.nodeType !== Node.TEXT_NODE) return; | |
child_el.nodeValue = child_el.nodeValue.replace(shit_regex, shitty_word); | |
}); | |
}; | |
replacer(document.body); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment