I create a new script, but it don't install...

I creatye a new script for the webmail address http://www.ig.com.br/, but it don't work.

The script is based in the globomial script from mota.luciano@gmail.com .  It goes below:

/***********************************************************
IGMail http://mail.mailig.ig.com.br
Version 1.2

Changelog:
1.1 - Login process update
1.2 - Login process update
1.3 - Update to be compatible with X-notifier and login process update
***********************************************************/
var name="GloboMail";
var ver="2013-01-25";
var supportInboxOnly=true;
var supportShowFolders=true;
var supportIncludeSpam=true;

function init(){
  this.initStage=ST_PRE;
  var ar=this.user.split("@");
  this.baseURL="http://mail.mailig.ig.com.br/";
  this.homeURL=this.baseURL;
  this.baseLoginURL="https://login.ig.com.br/signin?skin=authmail-ig";
  this.loginData=[this.baseLoginURL,"login-passaporte","senha-passaporte",
                 "botaoacessar=acessar&urlRetorno="+encodeURIComponent(this.homeURL)];
  this.mailDomain="^mail.mailig.ig.com.br";
  this.dataURL=this.homeURL;
}
function getIconURL(){
  return "https://www.google.com/a/ig.com.br/images/logo.gif?alpha=1";
}
function checkLogin(aData){
  switch(this.stage){
  case ST_CHECK:
    var st="ST_CHECK";
    this.getHtml(this.homeURL);
    return false;
  case ST_CHECK+1:
    var st="ST_CHECK+1";
    var fnd=aData.match(/input[\S\s]+?name="login-passaporte"/);
    if(!fnd){//logged in
        this.stage=ST_LOGIN_RES+3;
      return this.process(aData);
    }else{
        this.stage=ST_LOGIN;
      return this.process(aData);
    }
  }
  this.onError();
  return true;
}
function isLoggedIn(aData){
  var reg=new RegExp("\"\\/mail(?:\\/u\\/(\\d+))?\",\\S+?,\"(\\S+?)\"");
  var fnd=aData.match(reg);
  if(fnd){
    this.viewURL=this.baseURL+(fnd[1]?"u/"+fnd[1]:"");
    this.dataURL=this.viewURL+"?ui=2&ik="+fnd[2]+"&view=tl&start=0&num=25&rt=c&as_has=is%3Aunread&as_subset="+(this.inboxOnly?"inbox":"all")+"&search=adv";
    var fnd3=aData.match(/"sx_iosc","(\S+?)"/);
    if(fnd3&&(fnd3[1]=="^u|"||fnd3[1]=="^t|"))this.useInboxCount=true;
    var fnd4=aData.match(/"ix_ioiut","(\S+?)"/);
    if(fnd4&&fnd4[1]=="1")this.useInboxCount=true;
    this.UI=2;
    return 1;
  }
  //basic HTML
  fnd=aData.match(/<base href="(\S+?)">/);
  if(fnd){
    this.viewURL=fnd[1];
    this.dataURL=fnd[1]+"?s=q&q=is%3Aunread"+(this.inboxOnly?"+in%3Ainbox":"");
    this.UI=0;
    return 1;
  }
  return -1;
}
function process(aData, aHttp) {
  switch(this.stage){
  case ST_PRE:
    this.stage=ST_LOGIN;
    var st="ST_PRE";
    this.getHtml(this.homeURL); // set cookie
    return true;
  case ST_LOGIN:
    this.stage=ST_LOGIN_RES;
    var st="ST_LOGIN";
    this.getHtml(this.loginData[LOGIN_URL],this.loginData[LOGIN_POST]);
    return true;
  case ST_LOGIN_RES: //201
    var st="ST_LOGIN_RES";
    var fnd=aData.match(/(name="redir")/);
    if(fnd){
      var fnd2=aData.match(/form\s+action="(\S+?)"/);
      if(fnd2)this.loginData[LOGIN_URL]=fnd2[1];
      this.stage=ST_LOGIN_RES+1;
      this.getHtml(this.loginData[LOGIN_URL]);
      return true;
    }
    this.onError();
    return true;
  case ST_LOGIN_RES+1: //202
    var st="ST_LOGIN_RES+1";
    var fnd=aData.match(/(name="redir")/);
    if(fnd){
      var formURL=aData.match(/form\s+action="(\S+?)"/);
      var post=getForm2(aData,"redir");

      if(post){
        if(formURL)this.loginData[LOGIN_URL]=formURL[1];
        this.stage=ST_LOGIN_RES+2;
        this.getHtml(this.loginData[LOGIN_URL],post);
    this.loginData[LOGIN_URL]=this.baseURL;
      }
      return true;
    }
    this.onError();
    return true;
  case ST_LOGIN_RES+2: //203
    var st="ST_LOGIN_RES+2";
    this.stage=ST_LOGIN_RES+2;
    var fnd=aData.match(/["']\d+;[uU][rR][lL]\s*?=\s*?(\S+?)['"]/);
    if(fnd) {
      fnd=fnd[1].replace(/&amp;/ig,"&");
      this.getHtml(fnd);
    } else {
        this.stage=ST_LOGIN_RES+3;
    }
    return true;
  case ST_LOGIN_RES+3: //204
    var st="ST_LOGIN_RES+3";
    if(this.isLoggedIn(aData)==1)this.stage=ST_DATA;
    break;
  }
  return this.baseProcess(aData, aHttp);
}
function getCount(aData){
  var fnd;
  if(this.UI==2){
    if(this.inboxOnly)fnd=aData.match(this.useInboxCount?/"ld",\[[\S\s]*?\["\^i",(\d+)/:/"ld",\[\["\^ig?",(\d+)/);
    else fnd=aData.match(/\["ti",.+?,(\d+)/);
    if(fnd){
      if(this.includeSpam){
        var fnd2=aData.match(/"ld",\[\[[\S\s]+?"\^s",(\d+)/);
        if(fnd2){
          var spam=parseInt(fnd2[1]);
          if(spam>0){
            this.spam=spam;
            return parseInt(fnd[1])+this.spam;
          }
        }
      }
      return fnd[1];
    }else return -1;
  }else{
    var spam=0;
    if(this.includeSpam){
      fnd=aData.match(/<a href="\?s=m"\s*\S+?\((\d+)\)/);
      if(fnd){
        spam=parseInt(fnd[1]);
        if(spam>0)this.spam=spam;
      }
    }
    if(this.inboxOnly){
      fnd=aData.match(/<\/h2>\s*<tr>\s*<td[\s\S]+?<a[\s\S]+?>.+?(?:&nbsp;\s*\(\s*(\d+)\s*\))?\s*</);
      return fnd?((fnd[1]?parseInt(fnd[1]):0)+spam):-1;
    }else{
      fnd=aData.match(/nvp_bbu_go[\s\S]+?<\/td>([\s\S]+?)<\/table>/);
      if(fnd){
        var n=0;
        var fnd2=fnd[1].match(/<b>(\S+)<\/b>(.+?)<b>(\d+)<\/b>(.+?)<b>(\S+)<\/b>/);
        if(fnd2){
          if(fnd2[2].indexOf("-")!=-1)n=isNaN(parseInt(fnd2[5]))?200:fnd2[5];
          else if(fnd2[4].indexOf("-")!=-1)n=isNaN(parseInt(fnd2[1]))?200:fnd2[1];
        }
        return parseInt(n)+spam;
      }else return -1;
    }
  }
}
function getViewURL(aFolder){
  if(aFolder){
    if(aFolder=="Spam"){
      if(this.UI==2)return this.viewURL+"#spam";
      else return this.viewURL+"?s=m";   
    }
    if(this.UI==2)return this.viewURL+"#label/"+encodeURIComponent(aFolder);
    else return this.viewURL+"?s=l&l="+encodeURIComponent(aFolder);
  }
  return this.viewURL;
}
function getData(aData){
  var obj={};
  if(!this.showFolders)return obj;
  var ar=[];
  var fnd;
  if(this.UI==2){
    fnd=aData.match(/\["ld"\s*,\s*\[(?:,?\[.+?\]\n)+\]\n,\[((?:,?\[.+?\]\n)+)\]\n/);
    if(fnd){
      var re=/\[\"(.+)\"\s*,\s*(\d+)/g;
      var o;
      while ((o = re.exec(fnd[1])) != null){
        if(parseInt(o[2])>0){
          ar.push(o[1]);
          ar.push(o[2]);
        }
      }     
    }
  }else{
    fnd=aData.match(/<td class="?lb"?>([\s\S]+?)<a class="ml"/);
    if(fnd){
      var re=/<a href="(\S+?)">\s*<font[\s\S]+?>(.+?)(?:&nbsp;\s*\(\s*(\d+)\s*\))?\s*</g;
      var o;
      while ((o = re.exec(fnd[1])) != null){
        if(parseInt(o[3])>0){
          ar.push(o[2]);
          ar.push(o[3]);
        }
      }
    }
  }
  if(this.spam!=null){
    ar.push("Spam");
    ar.push(this.spam);
    delete this.spam;
  }     
  if(ar)obj.folders=ar; 
  return obj;
}
function getForm2(data,name){
  var st="getForm2";
  if(name){
    var reg=new RegExp("<form.+?name\\s*=\\s*[\"\']"+name+"[\"\']([\\S\\s]+?)<\/form>","i");
    var s=data.match(reg);
    if(!s)return "";
    data=s[1];
  }
  var re=/<textarea.+?name\s*=\s*['"](\S+?)['"].*?>([\s\S]+?)<\/textarea>/ig;
  var o;
  var post="";
  while ((o = re.exec(data)) != null){
    if(post)post+="&";
    o[2]=o[2].replace(/&amp;/ig,"&");
    post+=o[1]+"="+encodeURIComponent(o[2]);
  }
  return post;
}

tobwithu's picture

At least, it does not have syntax error.
I need an account to test it.
Please mail to xndevel@gmail.com

Rudi Kreinz's picture

Hi, bin neu hier.

Ich habe ein vorgefertigtes Script für  MAILBOX.ORG gefunden! Wie installiere ich das Script in FIREFOX?

 

Danke

Rudi Kreinz

Deutsche Übersetzung (durch freetranslation.com) ist unterhalb der englische Text:

I am just a user of X-Notifier. I am not the developer of this program.
X-Notifier 4.x does not support custom script installation by user.
The developers of Firefox changed the add-on programming and scripts for X-Notifier 4. x must be embedded in the add-on software.
X-Notifier 3.x supports the installation of a custom script written by the user.
X-Notifier 3.x is designed for use with Firefox 56 and older.

Also, there is already a script for mailbox.org in the list of scripts:
http://xnotifier.tobwithu.com/scripts.php?key=name&dir=1&page=3

----------------------------------------------------------------------------------------

Ich bin nur ein Benutzer von X-Notifier. Ich bin nicht der Entwickler dieses Programms.
X-Notifier 4.x unterstützt keine benutzerdefinierten Skript Installation durch Benutzer zulassen.
Die Entwickler von Firefox geändert die Add-on-Programmierung und Skripte für X-Notifier 4. x muss in der Add-on-Software eingebettet werden.
X-Notifier 3.x unterstützt die Installation eines benutzerdefinierten Skript durch den Benutzer.
X-Notifier 3.x ist für den Einsatz mit Firefox 56 und älter.

Auch gibt es bereits ein Skript für mailbox.org in der Liste Skripte:
http://xnotifier.tobwithu.com/scripts.php?key=name&dir=1&page=3

 

Rudi Kreinz's picture

Danke RPD! Genau diese Script verwende ich! Aber ich weiß nicht, wie ich es installiere! Habe es heruntergeladen, gestartet und als Passwort versuchsweise "tobwithu" einzugeben versucht. (Kenne kein Passwort) Aber es hat sich nichts getan?

Liebe Grüße

 

Thanks RPD! Exactly these script I use! But I do not know how to install it! I downloaded it, started it and attempted to enter "tobwithu" as a password. (Do not know a password) But nothing has changed?

best regards

Rudi Kreinz

Deutsche Übersetzung (durch freetranslation.com) ist unterhalb der englische Text:

1) What browser are you using?

Firefox? Or Chrome? Or Opera? Or Safari? Or Edge? Or...?

2) X-Notifier (version 4.x) for Firefox does not allow installation of custom scripts.

3) You can install custom scripts in the X-Notifier (Version 4) for chrome/Opera/Safari.

With X-Notifier in Chrome or Opera or Safari, click X-Notifier "Options", in order to install the script... under "Options", you will see a button "Scripts"... click on the button "Scripts", and then click "Add", and locate the mailbox.org script, and click "Open"... and then click OK. The script is installed.

4) You have already gone mailbox.org... and have a user name and a password, yes?

5) After the mailbox.org script is installed ... Then enter your username and password. In the X-Notifier "Options". you select the checkbox to the left of the scripts (where it shows "Gmail".) a list of installed scripts are displayed, you will find the mailbox.org script in the list and select it. Then fill in your user name and password for your account mailbox.org. After you have entered the information, click the Add button.

After you have clicked the "Add" button, you will need to scroll down and then click the "Save" button.

Follow the same procedure to add a custom script X-Notifier... then your account... in Opera or Safari.

X-Notifier (Version 4) For Firefox does not allow custom scripts.

The X-Notifier scripts that are available with Firefox... are already included in the list of scripts provided by the developer.

-------------------------------------------------------------------------------------------------

1) Welchen Browser verwenden Sie?

Firefox? Oder Chrom? Oder Oper? Oder Safari? Oder Kante? Oder...?

2) X-Notifier (Version 4.x) für Firefox erlaubt keine Installation von benutzerdefinierten Skripts.

3) Sie können benutzerdefinierte Skripte in X-Notifier installieren (Version 4) für Chrom/Opera/Safari.

Mit X-Notifier in Chrome oder Opera oder Safari, klicken Sie auf X-Notifier "Optionen", um das Skript zu installieren... unter "Optionen", sehen Sie eine Schaltfläche "Skripte"... klicken Sie auf die Schaltfläche "Skripte", und klicken Sie dann auf "Hinzufügen", und suchen Sie die mailbox.org Skript auszuwählen, und klicken Sie auf "Öffnen"... und klicken Sie dann auf OK. Das Skript installiert ist.

4) Sie haben bereits mailbox.org... gegangen und haben einen Benutzernamen und ein Passwort, ja?

5) Nach dem mailbox.org Script installiert ist ... Dann geben sie ihren Benutzernamen und ihr Passwort ein. In X-Notifier "Optionen". Sie aktivieren Sie das Kontrollkästchen links von der Schaltfläche Skripte (wo es schon zeigt "Google Mail".) Eine Liste der installierten Skripte angezeigt werden, finden Sie die mailbox.org Script in der Liste und wählen sie/Sie darauf. Dann füllen Sie Ihren Benutzernamen und Ihr Kennwort für Ihr Konto mailbox.org. Nachdem Sie die Informationen eingegeben haben, klicken Sie auf die Schaltfläche Hinzufügen.

Nachdem Sie die Schaltfläche "Hinzufügen" geklickt haben, müssen Sie einen Bildlauf nach unten durch, und klicken Sie dann auf die Schaltfläche Speichern.

Folgen Sie dem gleichen Verfahren ein benutzerdefiniertes Skript zu X-Notifier hinzufügen... dann Ihr Konto definieren... in Opera oder Safari.

X-Notifier (Version 4) für Firefox nicht benutzerdefinierte Skripts ermöglichen.

Die X-Notifier Scripts, die mit Firefox verfügbar sind... sind bereits in der Liste der Skripte durch den Entwickler zur Verfügung gestellt.1) Welchen Browser verwenden Sie?

Firefox? Oder Chrom? Oder Oper? Oder Safari? Oder Kante? Oder...?

2) X-Notifier (Version 4.x) für Firefox erlaubt keine Installation von benutzerdefinierten Skripts.

3) Sie können benutzerdefinierte Skripte in X-Notifier installieren (Version 4) für Chrom/Opera/Safari.

Mit X-Notifier in Chrome oder Opera oder Safari, klicken Sie auf X-Notifier "Optionen", um das Skript zu installieren... unter "Optionen", sehen Sie eine Schaltfläche "Skripte"... klicken Sie auf die Schaltfläche "Skripte, und klicken Sie dann auf "Hinzufügen", und suchen Sie die mailbox.org Skript auszuwählen, und klicken Sie auf "Öffnen"... und klicken Sie dann auf OK. Das Skript installiert ist.

4) Sie haben bereits mailbox.org... gegangen und haben einen Benutzernamen und ein Passwort, ja?

5) Nach dem mailbox.org Script installiert ist ... Dann geben sie ihren Benutzernamen und ihr Passwort ein. In X-Notifier "Optionen". Sie aktivieren Sie das Kontrollkästchen links von der Schaltfläche Skripte (wo es schon zeigt "Google Mail".) Eine Liste der installierten Skripte angezeigt werden, finden Sie die mailbox.org Script in der Liste und wählen sie/Sie darauf. Dann füllen Sie Ihren Benutzernamen und Ihr Kennwort für Ihr Konto mailbox.org. Nachdem Sie die Informationen eingegeben haben, klicken Sie auf die Schaltfläche Hinzufügen.

Nachdem Sie die Schaltfläche "Hinzufügen" geklickt haben, müssen Sie einen Bildlauf nach unten durch, und klicken Sie dann auf die Schaltfläche Speichern.

Folgen Sie dem gleichen Verfahren ein benutzerdefiniertes Skript zu X-Notifier hinzufügen... dann Ihr Konto definieren... in Opera oder Safari.

X-Notifier (Version 4) für Firefox nicht benutzerdefinierte Skripts ermöglichen.

Die X-Notifier Scripts, die mit Firefox verfügbar sind... sind bereits in der Liste der Skripte durch den Entwickler zur Verfügung gestellt.

Ich hoffe, dass die Übersetzung macht Sinn ;)

Rudi Kreinz's picture

Thank you!

I have FIREFOX and X-Notifier 4.1.8

I know now that this version of X-Notifier does not work! Pity!

Thanks for the detailed help

kind regards

Rudi Kreinz

Yes, it doesn't work for users wanting to load custom scripts.  :(
It only works for major scripts provided by the developer in the account Options. ;)