-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgmx.js
More file actions
51 lines (49 loc) · 1.5 KB
/
gmx.js
File metadata and controls
51 lines (49 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/**********************************************************
GMX(with navigator)
**********************************************************/
var name="GMX";
var ver="2015-12-02";
var supportMulti=true;
function init(){
this.dataURL="http://www.gmx.net/";
this.loginData=["https://service.gmx.net/de/cgi/login?hal=true","username","password","service=freemail"];
this.viewURL="http://www.gmx.net/";
}
function getIconURL(){
return "http://images.gmx.net/images/gmx/favicon.ico";
}
function getCount(aData){
var fnd=aData.match(/"mailbox_total_inbox":(\d+),/);
return fnd?fnd[1]:-1;
}
function process(aData,aHttp) {
switch(this.stage){
case ST_LOGIN_RES:
var fnd=aData.match(/'(\/\S+?(?:show|remindlogout)\?\S+?)'/);
if(fnd){//New UI
this.viewURL="https://navigator.gmx.net"+(fnd[1].replace(/remindlogout/,"show"));
fnd=this.viewURL.match(/(sid=.+?)(&|$)/);
if(fnd){
this.dataURL="https://home.navigator.gmx.net/servicetrinity/data?"+fnd[1];
this.keepAliveURL=this.viewURL.replace(/show/,"refresh");
this.viewURL+="#mail";
this.stage=ST_DATA;
}else break;
}else break;
case ST_DATA:
this.stage=ST_DATA_RES+1;
this.getHtml(this.keepAliveURL);
return true;
case ST_DATA_RES+1:
this.getHtml(this.viewURL);
return false;
case ST_DATA_RES+2:
this.stage=ST_DATA_RES;
if(aData.match(/nx\.Config\.extend/)){
this.getHtml(this.dataURL);
return true;
}
break;
}
return this.baseProcess(aData,aHttp);
}