粗略完成,细节再慢慢调,还要适应多站点
在 var sites = 前面加上这段
function getForumProfileUrl(url) {
if (/forum\.php.+&tid=\d+/.test(url)) {
return url.replace(/&extra.+$/, "")
}
return void 0
}
var forum_site = {
matches: /site/,
getMatchedNodes() {
return $$("a[href]:not(.utags_text_tag)").filter((element) => {
const href = element.href
const pathname = element.pathname
if (/forum\.php.+&tid=\d+/.test(href)) {
const key = href.replace(/\&extra.+$/, "")
const meta = { type: "user" }
element.utags = { key, meta }
return true
}
return false
})
},
excludeSelectors: [...default_default.excludeSelectors],
addExtraMatchedNodes(matchedNodesSet) {
const element2 = $("a[href]")
if (/forum\.php.+&tid=\d+/.test(element2.href)) {
const key = getForumProfileUrl(location.href)
// const element2 = $("a")
if (element2) {
const title = element2.textContent.trim()
if (title) {
const meta = { title, type: "user" }
element2.utags = { key, meta }
matchedNodesSet.add(element2)
}
}
}
},
}
var forum_default = forum_site
var sites = [
forum_default,
...
1
NoOneNoBody OP |
2
AthensBird 201 天前 1
|
3
BardOS 201 天前
用 chatgpt 改一下试试
|