|
发表于 2023-1-20 15:19:32
|
显示全部楼层
有自动翻译脚本的话,试试下面的脚本:
- // ==UserScript==
- // @name 恩山论坛修改帖子 href 值
- // @namespace http://tampermonkey.net/
- // @version 0.2
- // @description 修改帖子 href 值
- // @author You
- // @match *://www.right.com.cn/forum/*
- // @require https://gcore.jsdelivr.net/npm/arrive@2.4.1/minified/arrive.min.js
- // @grant none
- // ==/UserScript==
- (function () {
- 'use strict';
- const hrefReg = /(thread-\d+-\d+)-\d+(\.html.*)/i;
- function handler(parent) {
- const items = parent.querySelectorAll('a');
- items.forEach(item => {
- item.href = item.href.replace(hrefReg, '$1-1$2');
- });
- }
- handler(document);
- const threadlisttableid = document.querySelector('#threadlisttableid');
- threadlisttableid &&
- threadlisttableid.arrive('tbody', { existing: true }, tbody => {
- handler(tbody);
- });
- })();
复制代码 |
|