auto login dont fire events?

Viewed 24

i have a simple greasmonkey/tampermonkey script. On a particulaer website open my script insert login/password and click submit button. Here is the problem. The website is coded in reactjs and i can insert login/password in text field correct but when i click submit button it seems nothing was inserted, it seems like change event was not fired. I tried to manually fire a lot of events (change, keypress) but nothing seems to work. Any idea ?

if(url.indexOf("xxxx") > -1) { // login page
  waitForElement("button[type='submit']",function() {
    $("#Login").val(GM_getValue("login"));
    $("#Password").val(GM_getValue("password"));
    $("button[type='submit']").click();
  });
}

function waitForElement(elementPath, callBack){
  window.setTimeout(function(){
    if($(elementPath).length){
      callBack(elementPath, $(elementPath));
    }else{
      waitForElement(elementPath, callBack);
    }
  },500)
}
0 Answers
Related