Show Full Description

Añade un botón para mostrar completamente el texto truncado en descripciones de perfil.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Show Full Description
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  Añade un botón para mostrar completamente el texto truncado en descripciones de perfil.
// @author       Tú
// @match        https://www.xvideos.com/profiles/*
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    // Encuentra todos los elementos que contienen las descripciones truncadas
    const descriptions = document.querySelectorAll('.p-postcomment.overflowing');

    descriptions.forEach((description) => {
        // Crea el botón para expandir el texto
        const button = document.createElement('button');
        button.innerText = 'Mostrar más';
        button.style.margin = '5px';
        button.style.cursor = 'pointer';

        // Añade el botón antes del texto truncado
        description.parentNode.insertBefore(button, description);

        // Evento de clic para mostrar el texto completo
        button.addEventListener('click', () => {
            description.style.webkitLineClamp = 'unset'; // Remueve el límite de líneas
            description.style.overflow = 'visible';      // Hace visible el contenido completo
            button.style.display = 'none';               // Oculta el botón después de expandir
        });
    });
})();