Run script in web whatsapp

Tuesday, April 26, 2016

I tried to run the next code with Gracemonkey:

var myWindow = null;
var setTiming = 5; //sec
var isMSGOUT = 0;
var msgs = [];

function us_openWAwindows() {
    myWindow
= window.open("", "_blank", "toolbar=no,scrollbars=no,resizable=yes,top=500,left=500,width=400,height=400");
    myWindow
.document.body.innerHTML = "<p>Plz wait, loading...</p>";
   
   
//document.getElementById("startButton").disabled = true;
   
   
var main = document.getElementById("main").getElementsByClassName("message-list");
   
var list = main[0].getElementsByClassName("msg");
   
var i;
   
for (i = 0; i < list.length; i++) {
        list
[i].innerHTML += '<button type="button" class="addButton" onclick="javascript:addNewMsg(this.parentElement)">Add</button>';
   
}
   
    us_loadNewMsg
();
}

function us_loadNewMsg() {
   
if (msgs.length > 0)
   
{
        myWindow
.document.body.innerHTML = "<h3>" + msgs[0][0] + "</h3>";
       
       
if ( msgs[0][2] == 1 )
       
{
            myWindow
.document.body.innerHTML += "<img id='showIMG' src='" + msgs[0][1].src + "' style='height:" + msgs[0][1].height +"'>";
       
}
       
else
       
{
            myWindow
.document.body.innerHTML += msgs[0][1];
       
}
       
        msgs
.shift();
        isMSGOUT
=0;
   
} else if (isMSGOUT == 0) { myWindow.document.body.innerHTML += "<br /><br />add new"; isMSGOUT=1;}
    us_timing
();
}

function us_timing() {
    setTimeout
(loadNewMsg, setTiming*1000);
}

function us_addNewMsg(thisMSG) {
   
if ( thisMSG.getElementsByClassName("message-text").length > 0 )
   
{
        msgs
.push ([ thisMSG.getElementsByClassName("message-author")[0].getElementsByClassName("emojitext")[0].innerHTML,
                        thisMSG
.getElementsByClassName("message-text")[0].getElementsByClassName("emojitext")[0].innerHTML,
                       
0
                   
]);
   
}
   
else if ( thisMSG.getElementsByClassName("image-thumb").length > 0 )
   
{
        msgs
.push ([ thisMSG.getElementsByClassName("message-author")[0].getElementsByClassName("emojitext")[0].innerHTML,
                thisMSG
.getElementsByClassName("image-thumb")[0].getElementsByClassName("image-thumb-body")[0],
               
1
           
]);
   
}
   
    thisMSG
.getElementsByClassName("addButton")[0].disabled = true;
}

document
.body.innerHTML += '<div style="position:absolute;bottom:20px;right:20px;z-index:80;border:1px black solid"><button type="button" id="startButton" onclick="javascript:us_openWAwindows()">Start</button></div>';

however, it's add the button, but cannot click on it...
I tried bypass it and run us_openWAwindows, but it won't work

--
You received this message because you are subscribed to the Google Groups "JavaScript Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to javascript-information+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Copyright © 2010 Web Design | Free Blogger Templates by Splashy Templates | Layout by Atomic Website Templates

Vida de bombeiro Recipes Informatica Humor Jokes Mensagens Curiosity Saude Video Games Animals Diario das Mensagens Eletronica Rei Jesus News Noticias da TV Artesanato Esportes Noticias Atuais Games Pets Career Religion Recreation Business Education Autos Academics Style Television Programming Motosport Humor News The Games Home Downs World News Internet Design Entertaimment Celebrities 1001 Games Doctor Pets Net Downs World Enter Jesus Mensagensr Android Rub Letras Dialogue cosmetics Genexus lasofia thebushrajr wingshock tripedes gorduravegetal dainfamia dejavu-transpersonal jsbenfica republicadasbadanas ruiherbon iranianforaryans eaystcheyl fotosdanadir Só Humor Curiosity Gifs Medical Female American Health Madeira Designer PPS Divertidas Estate Travel Estate Writing Computer Matilde Ocultos Matilde futebolcomnoticias girassol lettheworldturn topdigitalnet Bem amado enjohnny produceideas foodasticos cronicasdoimaginario downloadsdegraca compactandoletras newcuriosidades blogdoarmario arrozinhoii