
document.addEventListener('DOMContentLoaded', function () {
    // Функция для удаления элементов, связанных с CloudComments
    const removeCloudComments = () => {
        const elements = document.querySelectorAll('*'); // Получаем все элементы на странице
        elements.forEach(el => {
            // Удаляем элементы, содержащие текст "CloudComments" или "Cloud Comments"
            if (el.textContent.includes('CloudComments') || el.textContent.includes('Cloud Comments')) {
                el.remove();
            }

            // Удаляем элементы с атрибутом href="https://cloudcomments.ru/"
            if (el.tagName === 'A' && el.href === 'https://cloudcomments.ru/') {
                el.remove();
            }

            // Удаляем элементы с классами или идентификаторами, содержащими "cloudcomments"
            if (el.className.includes('cloudcomments') || el.id.includes('cloudcomments')) {
                el.remove();
            }
        });
    };

    // Выполняем удаление сразу после загрузки страницы
    removeCloudComments();

    // На случай динамической подгрузки popup
    const observer = new MutationObserver(() => {
        removeCloudComments();
    });

    // Наблюдаем за изменениями в DOM
    observer.observe(document.body, { childList: true, subtree: true });
});

