F-List Quote Text Remover

Removes the "Quote:" text from quote boxes on F-List profiles.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         F-List Quote Text Remover
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  Removes the "Quote:" text from quote boxes on F-List profiles.
// @author       You
// @match        https://www.f-list.net/c/*
// @match        https://www.f-list.net/chat/view_log.php*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Selector for the element containing "Quote:"
    const selector = "div.QuoteHeader";

    function removeQuoteHeaderText() {
        const quoteHeaders = document.querySelectorAll(selector);
        quoteHeaders.forEach(header => {
            // Option 1: Hide the entire header element (most common and cleanest)
            header.style.display = 'none';

            // Option 2: If you only wanted to clear the text but keep the element (less likely):
            // header.textContent = '';

            // Option 3: If the text "Quote:" might be accompanied by other text
            // in the same div.QuoteHeader that you want to keep (unlikely given the name):
            // if (header.textContent.trim().toLowerCase().startsWith("quote:")) {
            //     header.innerHTML = header.innerHTML.replace(/Quote:/i, '');
            // }
        });
    }

    // Run the function when the page loads
    // Using DOMContentLoaded is often better as it fires earlier than 'load'
    if (document.readyState === 'loading') {
        document.addEventListener('DOMContentLoaded', removeQuoteHeaderText);
    } else {
        // DOMContentLoaded has already fired
        removeQuoteHeaderText();
    }

    // F-List might load content dynamically (e.g., in chat logs or when switching tabs).
    // A MutationObserver handles elements added after the initial page load.
    const observer = new MutationObserver(function(mutations) {
        let needsUpdate = false;
        mutations.forEach(function(mutation) {
            if (mutation.addedNodes.length) {
                // Check if any added nodes are or contain the target selector
                mutation.addedNodes.forEach(function(node) {
                    if (node.nodeType === 1) { // Check if it's an element node
                        if (node.matches(selector) || node.querySelector(selector)) {
                            needsUpdate = true;
                        }
                    }
                });
            }
        });
        if (needsUpdate) {
            removeQuoteHeaderText();
        }
    });

    // Start observing the document body for added child nodes and subtree modifications
    observer.observe(document.body, { childList: true, subtree: true });

    // Initial run in case content is already there (though DOMContentLoaded should cover most static cases)
    removeQuoteHeaderText();

})();