Make the navigation easier.
当前为
// ==UserScript==
// @name SubscribeStar Ellipsify69
// @version 2024-02-26
// @description Make the navigation easier.
// @namespace https://greasyfork.org/users/1267336
// @author ProtagNeptune
// @match https://subscribestar.adult/*
// @match https://www.subscribestar.com/*
// @exclude https://subscribestar.adult/chats/*
// @exclude https://subscribestar.adult/posts/*
// @exclude https://www.subscribestar.com/chats/*
// @exclude https://www.subscribestar.com/posts/*
// @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 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