Greasy Fork 还支持 简体中文。

Whatsapp spam 2.0

Made by Macr1408 (Also known as Razor1408) for razor.260mb.org

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Whatsapp spam 2.0
// @namespace    http://razor.260mb.org
// @version      2.0
// @description  Made by Macr1408 (Also known as Razor1408) for razor.260mb.org
// @author       Macr1408
// @match        https://web.whatsapp.com/
// @grant        none
// ==/UserScript==

function general(){
    item = document.createElement("div");
    item.innerHTML = "<img src='http://k30.kn3.net/9CE61B28D.png' style='width:24px;height:24px;' id='spam'>"
    item2 = document.getElementsByClassName("pane-header pane-list-header")[0];
    item2.insertBefore(item, item2.childNodes[1]);
    panel = document.getElementsByClassName("pane pane-list")[0];
    elemento = document.createElement("div");
    elemento.innerHTML = "<header class='pane-header pane-list-header'><input type='text' id='mensaje' size='30'><input type='number' min='1' id='repeticiones' style='width:50px'>Times </header>";
    panel.insertBefore(elemento, panel.childNodes[1]);
    document.getElementById("spam").addEventListener("click", spam);
}

setTimeout(general,5000);

function dispatch(target, eventType, char) {
   var evt = document.createEvent("TextEvent");    
   evt.initTextEvent (eventType, true, true, window, char, 0, "en-US");
   target.focus();
   target.dispatchEvent(evt);
}

function spam(){
  texto = document.getElementById("mensaje").value
  reps = document.getElementById("repeticiones").value
  campo = document.getElementsByClassName("input")[1];
  contador = 1;
  while(contador<=reps){
    dispatch(campo, "textInput", texto); 
    var input = document.getElementsByClassName("icon btn-icon icon-send");
    input[0].click();
    contador++;
    setTimeout(function(){ }, 1);
  }
}