-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Karlheinz Niebuhr
committed
Aug 14, 2015
1 parent
d4362c8
commit c8e1483
Showing
6 changed files
with
113 additions
and
42 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" ] | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |