删除什么值得买当前页评论
// ==UserScript==
// @name 删除什么值得买当前页评论
// @namespace Violentmonkey Scripts
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://zhiyou.smzdm.com/user/fachupinglun/*
// @icon https://www.google.com/s2/favicons?domain=smzdm.com
// @grant none
// ==/UserScript==
(function() {
document.querySelector("body").innerHTML += `
<button id="nextPage" style="position: fixed;top: 2rem;margin: 0 auto;font-size:3rem;z-index:99">下一页</button>
<button id="deleteBtn" style="position: fixed;top: 6rem;margin: 0 auto;font-size:3rem;z-index:99">Delete Comment in this page<button>
`
document.querySelector("#deleteBtn").onclick = ()=> {
[...document.querySelectorAll("a.juBao")].forEach(it => it.click())
document.querySelector("a.lFloat").click()
}
document.querySelector("#nextPage").onclick = ()=> {
let page = parseInt(location.href.slice(-5).match(/\d+/)?.[0]) || 1
location.href = `https://zhiyou.smzdm.com/user/fachupinglun/p${page + 1}/`
}
})();