Greasy Fork

来自缓存

Greasy Fork is available in English.

小红书删评论

Holle

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         小红书删评论
// @license MIT
// @version      0.1.0
// @namespace     https://www.xiaohongshu.com
// @description  Holle
// @author       You
// @match        https://www.xiaohongshu.com/*
// @icon         https://www.xiaohongshu.com/favicon.ico
// @grant        none
// ==/UserScript==

(function() {
    "use strict";
  console.log("小红书脚本生效了");
    var i=0;
     createDeletePlButton()

  // 创建删除评论按钮
  function createDeletePlButton() {
    const mask = document.querySelector("#app");
    const button = document.createElement("button");
    button.textContent = "全部评论删除";
    button.style.position = "fixed";
    button.style.bottom = "65px";
    button.style.right = "20px";
    button.style.padding = "10px 20px";
    button.style.border = "none";
    button.style.backgroundColor = "#056b00";
    button.style.color = "#fff";
    button.style.fontFamily = "Arial, sans-serif";
    button.style.fontSize = "16px";
    button.style.fontWeight = "bold";
    button.style.cursor = "pointer";
      button.style.zIndex = 10000;
    button.addEventListener("click", function () {
      exportMd();
    });
    mask.appendChild(button);
  }
function exportMd() {
    console.log(123)
    const m=document.querySelector('.menu-wrapper>.menu-item')
    console.log(m)
    if (!m&&i<=10) {
        i++;
        exportMd()
        // 元素不存在
    }else if(m){
    console.log(i)
        m.click();
       setTimeout(() => {queren(m); }, 2000);
    }

  }
    function queren(obj){
        obj.blur();
          const ml=document.querySelector('.strong')
          console.log(ml)
        if (!ml&&i<=10) {
            setTimeout(() => {queren(obj); }, 2000);

            // 元素不存在
        }else if(ml){

            console.log(i)
            i=0
            ml.click()
           setTimeout(() => {exportMd(); }, 1000);
        }

    }


    // Your code here...
})();