Telegram Web Media Forward On Private Channel

Tự động chuyển tiếp hoặc tải media từ kênh riêng tư trên Telegram Web

当前为 2025-06-28 提交的版本,查看 最新版本

// ==UserScript==
// @name         Telegram Web Media Forward On Private Channel
// @name:en      Telegram Web Media Forward On Private Channel
// @name:vi      Telegram Web Chuyển Tiếp Media Trên Kênh Riêng Tư
// @namespace    http://tampermonkey.net/
// @version      1.1.3
// @description  Tự động chuyển tiếp hoặc tải media từ kênh riêng tư trên Telegram Web
// @description:en Auto forward or download media from private Telegram channels
// @description:vi Tự động chuyển tiếp hoặc tải media từ kênh riêng tư trên Telegram Web
// @author       TurtleD
// @match        https://web.telegram.org/*
// @match        https://webk.telegram.org/*
// @match        https://webz.telegram.org/*
// @grant        none
// @license      D07
// @icon         https://www.google.com/s2/favicons?sz=64&domain=telegram.org
// ==/UserScript==

(function() {
    //Enable forward and delete button
    //Observe when the .selection-wrapper element appears to enable Forward and Delete buttons
    const selectionObserver = new MutationObserver((mutationsList, observer) => {
        const selectionWrapper = document.querySelector('.chat-input-wrapper.selection-wrapper');
        if (selectionWrapper) {
            const forwardBtn = document.querySelector('.selection-container-forward');
            const deleteBtn = document.querySelector('.selection-container-delete');

            if (forwardBtn) forwardBtn.disabled = false;
            if (deleteBtn) deleteBtn.disabled = false;
        }
    });

    selectionObserver.observe(document.body, {
        childList: true,
        subtree: true
    });

function addCheckboxToAlbumItems() {
  // Get all album-item
  const albumItems = document.querySelectorAll('.album-item');

  albumItems.forEach((item, index) => {
    // Check checkbox-field and add new
    if (!item.querySelector('.checkbox-field')) {
      // Tạo phần tử checkbox
      const checkboxWrapper = document.createElement('label');
      checkboxWrapper.classList.add('checkbox-field', 'checkbox-field-round', 'checkbox-without-caption', 'bubble-select-checkbox');

      const checkboxInput = document.createElement('input');
      checkboxInput.type = 'checkbox';
      checkboxInput.id = `input-${index + 1}`; // Set ID for checkbox

      const checkboxBox = document.createElement('div');
      checkboxBox.classList.add('checkbox-box');

      const checkboxBorder = document.createElement('div');
      checkboxBorder.classList.add('checkbox-box-border');

      const checkboxBackground = document.createElement('div');
      checkboxBackground.classList.add('checkbox-box-background');

      const checkboxCheck = document.createElement('svg');
      checkboxCheck.classList.add('checkbox-box-check');
      checkboxCheck.setAttribute('viewBox', '0 0 24 24');
      const useElem = document.createElement('use');
      useElem.setAttribute('href', '#check');
      checkboxCheck.appendChild(useElem);

      // Create checkbox structure
      checkboxBox.appendChild(checkboxBorder);
      checkboxBox.appendChild(checkboxBackground);
      checkboxBox.appendChild(checkboxCheck);

      checkboxWrapper.appendChild(checkboxInput);
      checkboxWrapper.appendChild(checkboxBox);

      item.prepend(checkboxWrapper);  // Add checkbox in album-item
    }
  });
}

addCheckboxToAlbumItems();


})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址