Messages Count

Shows how many messages the current conversation has

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==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();
})();