Greasy Fork is available in English.

Telegram 无限制转发删除(使用火狐浏览器有效)

Telegram 突破按钮限制(转发与删除)脚本,适合网页端telegram使用。安装该脚本插件,建议使用火狐!chrome内核浏览器无效!

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

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

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Telegram 无限制转发删除(使用火狐浏览器有效)
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  Telegram 突破按钮限制(转发与删除)脚本,适合网页端telegram使用。安装该脚本插件,建议使用火狐!chrome内核浏览器无效!
// @author       啤酒花
// @license      GNU GPLv3
// @match        https://web.telegram.org/*
// @match        https://webk.telegram.org/*
// @match        https://webz.telegram.org/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Function to enable buttons
    function enableButtons() {
        // Select the forward button
        const forwardButton = document.querySelector('button.selection-container-forward');
        const deleteButton = document.querySelector('button.selection-container-delete');

        // Remove 'disabled=""' attribute if it exists
        if (forwardButton) {
            forwardButton.removeAttribute('disabled');
        }
        if (deleteButton) {
            deleteButton.removeAttribute('disabled');
        }
    }

    // Initial check when the page loads
    enableButtons();

    // MutationObserver to watch for DOM changes and re-enable buttons
    const observer = new MutationObserver(() => {
        enableButtons();
    });

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