Greasy Fork

Greasy Fork is available in English.

WhatsApp Web Spammer

Spam people with this beautiful WhatsApp Web spammer.

当前为 2017-12-06 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         WhatsApp Web Spammer
// @namespace    http://tampermonkey.net/
// @version      0.3
// @description  Spam people with this beautiful WhatsApp Web spammer.
// @author       Dan6erbond
// @match        https://web.whatsapp.com/*
// @grant        none
// ==/UserScript==

//WhatsApp Web Spammer
//Insert this code into console
//This script is also available on Greasyfork:
//http://greasyfork.icu/de/scripts/36066-whatsapp-web-spammer

var repeatingSpamFunction = null;
var repeatingCreateSpamButtonFunction = null;
var message = '';

repeatingCreateSpamButtonFunction = window.setInterval(function(){
  createSpamButton();
}, 0);

function createSpamButton () {
  var composeBar = document.getElementsByClassName('block-compose')[0];
  if(composeBar == null)
    return;
  if(document.getElementById('spamButton') != null){
    window.clearInterval(repeatingCreateSpamButtonFunction);
    return;
  }
  var spamButton = document.createElement('a');
  spamButton.setAttribute("id", "spamButton");
  spamButton.innerHTML = 'SPAM';
  spamButton.style = 'padding:0px 0px 10px 10px';
  spamButton.href = '#';
  spamButton.onclick = function(){
    doSpam(this);
  };
  composeBar.insertBefore(spamButton, composeBar.childNodes[2]);
}

function sendMessage () {
  var evt = new Event('input', {
    bubbles: true
  });

  var input = document.getElementsByClassName('pluggable-input-body')[0];
  input.innerHTML = message;
  input.dispatchEvent(evt);

  document.getElementsByClassName('compose-btn-send')[0].click();
}

function doSpam(element) {
  if(element.innerHTML == 'SPAM'){
    element.innerHTML = 'STOP';
    var input = document.getElementsByClassName('pluggable-input-body')[0];
    message = input.innerHTML;
    var interval = parseInt (prompt('Please enter spam-interval:', ''));
    repeatingSpamFunction = window.setInterval(function(){
      sendMessage();
    }, interval);
  } else {
    element.innerHTML = 'SPAM';
    window.clearInterval(repeatingSpamFunction);
  }
}