Questionable Questing Userscript

removing the remaining replies and renaming the last page button

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        Questionable Questing Userscript
// @description removing the remaining replies and renaming the last page button
// @match       https://forum.questionablequesting.com/*
// @license MIT 
// @version 0.0.1.20240110214931
// @namespace https://greasyfork.org/users/1230490
// ==/UserScript==

(function() {
    try {
        // Select the first element with the class 'u-dimmed' representing the 'remaining replies' section
let remainingReplies = document.querySelectorAll('.linkGroup')[1]

// Check if the 'remaining replies' section exists on the page
if (remainingReplies != null) {
    // Remove the 'remaining replies' section from the page if it's found
    remainingReplies.remove();
}
    } catch (error) {
        console.error("Error removing 'remaining replies' section:", error.message);
    }

})();

(function() {
    try {
        let navItems = document.querySelectorAll('.PageNav nav a');

navItems.forEach((item, index) => {
  if (item.textContent.includes('Next')) {
    let prevElement = navItems[index - 1];
    prevElement.textContent = 'Last';
  }
});
    } catch (error) {
        console.error("Error renaming page navigation buttons:", error.message);
    }
})();