Greasy Fork is available in English.

Messages Count

Shows how many messages the current conversation has

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey, Greasemonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

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

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

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         Messages Count
// @namespace    http://tampermonkey.net/
// @license      GPLv3
// @version      2025-08-12
// @description  Shows how many messages the current conversation has
// @author       none
// @match        https://redacted.sh/inbox.php?action=viewconv&id=*
// @icon         none
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    // ##### Message Count ####

    // Function to add the messages label after the last message
    function insertAfter(referenceNode, newNode) {
        referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
    }

    // Get the number of messages
    var amountmsgs = document.querySelectorAll('.inbox_message').length;

    // Create the label to be added
    var msgslabel = document.createElement("h3");
    msgslabel.innerHTML = `Messages: ${amountmsgs}`;

    // Find the last message
    var ibmessages = document.querySelectorAll(".inbox_message");
    var lastmsg = ibmessages[ibmessages.length -1];
    // Add the label
    insertAfter(lastmsg, msgslabel);

    // #### Scroll to bottom automatically ####
    document.getElementById("messageform").scrollIntoView();
})();