catch being logged in, but stating that the account is not allowed to play ingress.

It will simply reload the page right now after 10s. The user is probably faster to do this
manually, but it solves the problem where the tab is opened and forgotten.
This commit is contained in:
Stefan Breunig 2013-02-10 19:39:28 +01:00
parent fb656a4982
commit 686497501b

13
main.js
View File

@ -28,6 +28,19 @@ for(var x in scr) {
break;
}
if(!d) {
// page doesnt have a script tag with player information.
if(document.getElementById('header_email')) {
// however, we are logged in.
setTimeout('location.reload();', 10*1000);
throw('Page doesnt have player data, but you are logged in. Reloading in 10s.');
}
// FIXME: handle nia takedown in progress
throw('Couldnt retrieve player data. Are you logged in?');
}
for(var i = 0; i < d.length; i++) {
if(!d[i].match('var PLAYER = ')) continue;
eval(d[i].match(/^var /, 'window.'));