Small Business -> Small Capitalists

Substitute the term 'small business' (and variants) for 'small capitalist' in each page you visit. You'll laugh, and then you'll cry.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name Small Business -> Small Capitalists
// @description Substitute the term 'small business' (and variants) for 'small capitalist' in each page you visit. You'll laugh, and then you'll cry.
// @author Alberta Advantage Podcast
// @version 4
// @namespace aapod_small_business
// @match http*://*/*
// @grant none
// ==/UserScript==

console.log("Running Business -> Capitalist Substitution")

function substitute () {
    let elements = document.querySelectorAll('*')
    for (let i = 0; i < elements.length; i++) {

        let element = elements[i]

        for (let j = 0; j < element.childNodes.length; j++) {

            let childNode = element.childNodes[j]
            if (childNode.nodeName !== '#text') {
                continue
            }

            // NB: Need to substitute the plural form first, or we'll replace the singular form inside plural forms
            childNode.textContent = childNode.textContent.replace(/Small[ -]Businesses/g, "Small Capitalists")
            childNode.textContent = childNode.textContent.replace(/small[ -]Businesses/g, "small Capitalists")
            childNode.textContent = childNode.textContent.replace(/Small[ -]businesses/g, "Small capitalists")
            childNode.textContent = childNode.textContent.replace(/small[ -]businesses/g, "small capitalists")
            childNode.textContent = childNode.textContent.replace(/Small[ -]Business/g, "Small Capitalist")
            childNode.textContent = childNode.textContent.replace(/small[ -]Business/g, "small Capitalist")
            childNode.textContent = childNode.textContent.replace(/Small[ -]business/g, "Small capitalist")
            childNode.textContent = childNode.textContent.replace(/small[ -]business/g, "small capitalist")

        }

    }

}

if (document.readyState === "complete" || document.readyState === "loaded" || document.readyState === "interactive") {
    substitute()
}
else {
    document.addEventListener('DOMContentLoaded', function () {
        // Substitute server-rendered small businesses on load
        substitute()
        // This is an imperfect attempt to catch dynamically loaded/rendered content. It won't work on every page!
        window.setTimeout(substitute, 500) // 500ms delay
    })
}