-
Notifications
You must be signed in to change notification settings - Fork 0
/
mailDeleter.js
49 lines (45 loc) · 1.43 KB
/
mailDeleter.js
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
// ==UserScript==
// @name delete mails
// @namespace https://webmail.iitg.ernet.in/src/right_main.php?PG_SHOWALL=1&use_mailbox_cache=1&startMessage=1&mailbox=INBOX
// @include https://webmail.iitg.ernet.in/src/right_main.php?PG_SHOWALL=1&use_mailbox_cache=1&startMessage=1&mailbox=INBOX
// @version 1
// @grant none
// ==/UserScript==
/*
* author - alpesh vas
*/
var table=document.getElementsByTagName("table")[7];
var webmailIds=["noticeboard","sports","security","patel","medsec","maintenance","mailman-owner",
"gtm","estb","engoff","elections","dos","arun","akb","vp@iitg","techniche","swc@","pro@i","placement@","clhod@","hackers@",
"techsec","gensec_welfare@","sport","cultsec","edc","alcheringa"];
var checked=false;
function check(withthis){
for(var i=0,len=webmailIds.length;i<len;++i){
if(withthis.startsWith(webmailIds[i])){
return true;
}
}
return false;
}
for ( var i=0;row=table.rows[i];i++){
var col=row.cells[1];
// console.log(col);
if(col!=null){
if(col.getElementsByTagName("label")[0]!=null){
var title=col.getAttribute("title");
var id=col.getElementsByTagName("label")[0].getAttribute("for");
if(check(title)){
document.getElementById(id).checked=true;
checked=true;
// console.log(title);
}
}
}
// title;
// console.log("done this ")
}
;
if(checked==true){
document.forms[0].submit();
// window.open("https://webmail.iitg.ernet.in/src/webmail.php");
}