Skip to content

Commit

Permalink
extension is working
Browse files Browse the repository at this point in the history
  • Loading branch information
Karlheinz Niebuhr committed Aug 14, 2015
1 parent d4362c8 commit c8e1483
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 42 deletions.
Binary file removed default_icon.png
Binary file not shown.
Binary file added icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions inject.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* Script to inject the javascript file into the page */
var s = document.createElement('script');

s.src = chrome.extension.getURL('popup.js');
s.onload = function() {
this.parentNode.removeChild(this);
};
(document.head||document.documentElement).appendChild(s);
15 changes: 11 additions & 4 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
{

"content_scripts": [ {
"js": [ "inject.js" ],
"matches": [ "https://web.whatsapp.com/*" ],
"run_at": "document_end"
}],


"manifest_version": 2,

"name": "Whatsapp bomb",
"description": "This extension allows you to send a whatsapp message bomb.",
"version": "1.0",
"homepage_url": "www.github.com",
"homepage_url": "https://github.com/Karlheinzniebuhr/Whatsapp-Bomb",


"browser_action": {
"default_icon": "icon.png",
"default_popup": "popup.html"
},
"permissions": [ "https://web.whatsapp.com" ],
"update_url": "https://clients2.google.com/service/update2/crx"

"update_url": "https://clients2.google.com/service/update2/crx",
"web_accessible_resources": [ "inject.js", "popup.js", "popup.html" ]
}


4 changes: 2 additions & 2 deletions popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<html>
<head>
<title>GTmetrix Analyzer</title>
<script src="popup.js"></script>

</head>
<body>
<h1>Whatsapp spammer</h1>
<h6>Select a conversation</h6>
<button id="checkPage">Start spamming the heck out of your friend!</button>
<button id="bomb">Start spamming the heck out of your friend!</button>
</body>
</html>
128 changes: 92 additions & 36 deletions popup.js
Original file line number Diff line number Diff line change
@@ -1,41 +1,97 @@
document.addEventListener('DOMContentLoaded', function() {
var checkPageButton = document.getElementById('checkPage');
var checkPageButton = document.getElementById('bomb');
checkPageButton.addEventListener('click', function() {

// control + shift + j to open console and paste
var count = 10; //number of times to send
var message = "spam message nr "; //spam message
var i = 0;

var nr = prompt("How many messages do you want to send?", "10");
if (nr != null) {
count = nr;
}

var msg = prompt("Enter your message: ", "spam count: ");
if (msg != null) {
message = msg;
}

var timer = setInterval( function(){
var evt = document.createEvent("TextEvent");
evt.initTextEvent ("textInput", true, true, window, message + count , 0, "en-US"); // initTextEvent(eventType, true ,true , window , Your TEXT ,0 , "en-US" )
document.querySelector(".input-container .input").focus(); //target.focus()
document.querySelector(".input-container .input").dispatchEvent(evt); //target.dispatch(event)
i++;
if( i == count )
clearInterval(timer);

console.log(i + " messages sent");

var event = new MouseEvent('click', {
'view': window,
'bubbles': true,
'cancelable': true
});
document.querySelector(".icon.btn-icon.icon-send").dispatchEvent(event);
},10);

bomb();

}, false);
}, false);
}, false);



// add that damn button
var btn = document.createElement("BUTTON");
var text = document.createTextNode("BOMB");

btn.appendChild(text);

btn.style.backgroundColor = 'red';
btn.style.padding = "5px 3px 5px 3px";

btn.onclick = function() {bomb()};


// Check every sencond if there is a button
/*
var interv = setInterval(function(){
elem = document.getElementsByClassName('menu-item')[2];
if(elem){
elem.appendChild(btn);
clearInterval(interv);
}
}, 1000);
*/

function setbutton(){
setTimeout( function(){
elem = document.getElementsByClassName('menu-item')[2];


if(elem){
elem.appendChild(btn);
}
},500)
};


function test(){alert('funciona')};

function load(){
chats = document.getElementsByClassName('chat');
for(var i=0;i<chats.length;i++){
chats[i].addEventListener('click', setbutton);
}
}


//check chat windows in interval
setInterval( function(){ load() },1000);




function bomb() {
// control + shift + j to open console and paste
var count = 10; //number of times to send
var message = "spam message nr "; //spam message
var i = 0;

var nr = prompt("How many messages do you want to send?", "10");
if (nr != null) {
count = nr;
}

var msg = prompt("Enter your message: ", "spam count: ");
if (msg != null) {
message = msg;
}

var timer = setInterval( function(){
var evt = document.createEvent("TextEvent");
evt.initTextEvent ("textInput", true, true, window, message + i , 0, "en-US"); // initTextEvent(eventType, true ,true , window , Your TEXT ,0 , "en-US" )
document.querySelector(".input-container .input").focus(); //target.focus()
document.querySelector(".input-container .input").dispatchEvent(evt); //target.dispatch(event)
i++;
if( i == count )
clearInterval(timer);

console.log(i + " messages sent");

var event = new MouseEvent('click', {
'view': window,
'bubbles': true,
'cancelable': true
});
document.querySelector(".icon.btn-icon.icon-send").dispatchEvent(event);
},10);
}

0 comments on commit c8e1483

Please sign in to comment.