commit 2edc45932b1be80ad693155b1d6b848fb1aadf57
parent 7b8f3bf9b53b1a25ac06549ad0f9081869393610
Author: Marcel <MTRNord@users.noreply.github.com>
Date: Tue, 15 Nov 2016 21:26:16 +0100
try fixing login
Diffstat:
| M | screencap_intel.js | | | 76 | ++++++++++++++++++++++++++++++++++++---------------------------------------- |
1 file changed, 36 insertions(+), 40 deletions(-)
diff --git a/screencap_intel.js b/screencap_intel.js
@@ -123,52 +123,48 @@ function login(l, p) {
document.querySelector("#next").click();
});
window.setTimeout(function () {
- if (!document.getElementById('Passwd')){
- firePlainLogin(l, p)
+ page.evaluate(function (p) {
+ document.getElementById('Passwd').value = p;
+ }, p);
+ if(document.querySelector("#next")){
+ page.evaluate(function () {
+ document.querySelector("#next").click();
+ });
}else{
- page.evaluate(function (p) {
- document.getElementById('Passwd').value = p;
- }, p);
- if(document.querySelector("#next")){
- page.evaluate(function () {
- document.querySelector("#next").click();
- });
- }else{
- page.evaluate(function () {
- document.querySelector("#signIn").click();
- });
- }
page.evaluate(function () {
- document.getElementById('gaia_loginform').submit();
+ document.querySelector("#signIn").click();
});
- window.setTimeout(function () {
- if (page.url.substring(0,40) === 'https://accounts.google.com/ServiceLogin') {
- quit('login failed: wrong email and/or password');
- }
+ }
+// 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,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 (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);
- }, 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);
},
error: function () {