Skip to content

Instantly share code, notes, and snippets.

@Prithvirajbilla
Last active October 11, 2016 12:27
Show Gist options
  • Select an option

  • Save Prithvirajbilla/50dc499242c32cbf81f4 to your computer and use it in GitHub Desktop.

Select an option

Save Prithvirajbilla/50dc499242c32cbf81f4 to your computer and use it in GitHub Desktop.

Revisions

  1. Prithvirajbilla revised this gist Apr 19, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion whatsapp.js
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    //Works on http://web.whatsapp.com
    // With little creativity and some coding skills you can do a lot of things to annoy some one.
    // With little creativity and some coding skills you can do a lot of things using this code to annoy some one.
    function dispatch(target, eventType, char) {
    var evt = document.createEvent("TextEvent");
    evt.initTextEvent (eventType, true, true, window, char, 0, "en-US");
  2. Prithvirajbilla revised this gist Apr 19, 2015. 1 changed file with 6 additions and 5 deletions.
    11 changes: 6 additions & 5 deletions whatsapp.js
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,11 @@
    //Works on http://web.whatsapp.com
    // With little creativity and some coding skills you can do a lot of things to annoy some one.
    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 triggerClick() {
    var event = new MouseEvent('click', {
    'view': window,
    @@ -17,6 +16,8 @@ function triggerClick() {
    }

    window.setInterval(function(){
    dispatch(document.querySelector(".block-compose .input"), "textInput", "hello!");
    dispatch(document.querySelector(".block-compose .input"), "textInput", "valar morghulis!");
    triggerClick();
    }, 60000);
    }, 1000);


  3. Prithvirajbilla revised this gist Apr 6, 2015. 1 changed file with 5 additions and 2 deletions.
    7 changes: 5 additions & 2 deletions whatsapp.js
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,6 @@ function dispatch(target, eventType, char) {
    }


    dispatch(document.querySelector(".block-compose .input"), "textInput", "hello!");

    function triggerClick() {
    var event = new MouseEvent('click', {
    @@ -16,4 +15,8 @@ function triggerClick() {
    });
    document.querySelector(".icon.btn-icon.icon-send").dispatchEvent(event)
    }
    triggerClick()

    window.setInterval(function(){
    dispatch(document.querySelector(".block-compose .input"), "textInput", "hello!");
    triggerClick();
    }, 60000);
  4. Prithvirajbilla revised this gist Apr 6, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion whatsapp.js
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@ function dispatch(target, eventType, char) {
    }


    dispatch(document.querySelector("#compose-input div"), "textInput", "hello!");
    dispatch(document.querySelector(".block-compose .input"), "textInput", "hello!");

    function triggerClick() {
    var event = new MouseEvent('click', {
  5. Prithvirajbilla created this gist Apr 6, 2015.
    19 changes: 19 additions & 0 deletions whatsapp.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    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);
    }


    dispatch(document.querySelector("#compose-input div"), "textInput", "hello!");

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