SubscribeStar Ellipsify69

Make the navigation easier.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         SubscribeStar Ellipsify69
// @version      2024-04-12
// @description  Make the navigation easier.
// @namespace    https://greasyfork.org/users/1267336
// @author       ProtagNeptune
// @match        https://subscribestar.adult/*
// @match        https://www.subscribestar.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=subscribestar.adult
// @license      MIT
// @grant        none
// ==/UserScript==

function ellipsify(str) {
    if (str.length > 69) {
        return str.substring(0, 69) + "...";
    } else {
        return str;
    }
}

function applyTruncation() {
    const currentUrl = window.location.href;
    const excludedPatterns = [
      'https://subscribestar.adult/chats/',
      'https://subscribestar.adult/posts/',
      'https://www.subscribestar.com/chats/',
      'https://www.subscribestar.com/posts/'
    ];
    if (!excludedPatterns.some(pattern => currentUrl.startsWith(pattern))) {
        const trixElements = document.querySelectorAll('.trix-content');
        trixElements.forEach((element) => {
            element.textContent = ellipsify(element.textContent);
        });
    }
}

// Call the function initially
applyTruncation();

// Repeat the function every three seconds
setInterval(applyTruncation, 3000); // 3000 milliseconds = 3 seconds