写了一个 macOS 的 App,可以在 Safari 中注入脚本,习惯用 Safari 的老哥可以尝试一下
資深大佬 : smilemm 3
https://apps.apple.com/cn/app/user-script/id1528337943?mt=12
大佬有話說 (15)
https://apps.apple.com/cn/app/user-script/id1528337943?mt=12
“`javascript
function $(element, selector) {
return […element.querySelectorAll(selector)]
}
if (window == window.top) {
let boxs = document.querySelectorAll(‘#Main > .box’)
let mainBox = boxs[1]
let cells = […mainBox.getElementsByClassName(‘cell’)]
cells.shift()
let dict = {}
for (let cell of cells) {
let name = $(cell, ‘strong > a’)[0]?.innerHTML ?? ”
dict[name] = cell
}
for (let cell of cells) {
let replyContent = $(cell, ‘.reply_content > a’)[0]
if (replyContent) {
let replyToName = replyContent.innerHTML
// console.log(replyToName)
dict[replyToName]?.appendChild(cell)
cell.style.marginLeft = ‘2em’
}
}
}
“`