按回帖时间排序

按回帖时间排序。

// ==UserScript==
// @name         按回帖时间排序
// @version      0.0.1
// @include      https://www.mcbbs.net/*
// @author       xmdhs
// @license MIT
// @description  按回帖时间排序。
// @namespace https://gf.qytechs.cn/users/166541
// ==/UserScript==
(() => {
    let li = document.querySelector("#filter_dateline_menu > ul > li")
    if (!li) {
        return
    }
    const href = li.querySelector("a").href
    let u = new URL(href)
    u.searchParams.set("orderby", "lastpost")
    u.searchParams.set("filter", "reply")

    //<span class="pipe">|</span>
    let span = document.createElement("span")
    span.className = "pipe"
    span.innerHTML = "|"

    let a = document.createElement("a")
    a.href = u.href
    a.textContent = "回帖时间"

    if (new URL(location.href).searchParams.get("orderby") === "lastpost") {
        a.className = "xw1"
    }

    li.appendChild(span)
    li.appendChild(a)
})();

QingJ © 2025

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