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.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==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
    })
}