commit 242a215197afc2a1031ec9929f167ff3297dbd88
parent 70f9eb6e4d60083f9256a33d1be53e92ab8bc8f1
Author: Marcel <MTRNord@users.noreply.github.com>
Date: Tue, 15 Nov 2016 21:18:58 +0100
Fix bug
Diffstat:
| M | screencap_iitc.js | | | 71 | ++++++++++++++++++++++++++++++++++++++++------------------------------- |
1 file changed, 40 insertions(+), 31 deletions(-)
diff --git a/screencap_iitc.js b/screencap_iitc.js
@@ -130,42 +130,51 @@ function login(l, p) {
});
}
window.setTimeout(function () {
- if (!document.getElementById('Passwd')){
+ if (!document.getElementById('Passwd')){
firePlainLogin(l, p)
- }
- page.evaluate(function (p) {
- document.getElementById('Passwd').value = p;
- }, p);
- page.evaluate(function () {
- document.querySelector("#next").click();
- });
- page.evaluate(function () {
- document.getElementById('gaia_loginform').submit();
- });
- window.setTimeout(function () {
- if (page.url.substring(0,40) === 'https://accounts.google.com/ServiceLogin') {
- quit('login failed: wrong email and/or password');
- }
- if (page.url.substring(0,40) === 'https://appengine.google.com/_ah/loginfo') {
+ }else{
+ page.evaluate(function (p) {
+ document.getElementById('Passwd').value = p;
+ }, p);
+ if(document.querySelector("#next")){
page.evaluate(function () {
- document.getElementById('persist_checkbox').checked = true;
- document.getElementsByTagName('form').submit();
+ document.querySelector("#next").click();
+ });
+ }else{
+ page.evaluate(function () {
+ document.querySelector("#signIn").click();
});
}
- if (page.url.substring(0,44) === 'https://accounts.google.com/signin/challenge') {
- //twostep = system.stdin.readLine();
- console.log("twostep Bug")
+ page.evaluate(function () {
+ document.getElementById('gaia_loginform').submit();
+ });
+ window.setTimeout(function () {
+ if (page.url.substring(0,40) === 'https://accounts.google.com/ServiceLogin') {
+ quit('login failed: wrong email and/or password');
+ }
+
+ if (page.url.substring(0,40) === 'https://appengine.google.com/_ah/loginfo') {
+ page.evaluate(function () {
+ document.getElementById('persist_checkbox').checked = true;
+ document.getElementsByTagName('form').submit();
+ });
+ }
+
+ if (page.url.substring(0,44) === 'https://accounts.google.com/signin/challenge') {
+ twostep = system.stdin.readLine();
+ }
+
+ // if (twostep) {
+ // page.evaluate(function (code) {
+ // document.getElementById('totpPin').value = code;
+ // }, twostep);
+ // page.evaluate(function () {
+ // document.getElementById('submit').click();
+ // document.getElementById('challenge').submit();
+ // });
+ // }
+ window.setTimeout(afterPlainLogin(IntelURL, search), loginTimeout);
}
- // if (twostep) {
- // page.evaluate(function (code) {
- // document.getElementById('totpPin').value = code;
- // }, twostep);
- // page.evaluate(function () {
- // document.getElementById('submit').click();
- // document.getElementById('challenge').submit();
- // });
- // }
- window.setTimeout(afterPlainLogin(IntelURL, search), loginTimeout);
}, loginTimeout)
}, loginTimeout / 10);
},