zoukankan      html  css  js  c++  java
  • WebMail Notifier的插件,for www.126.com的邮箱

    下面就是这个插件的代码。

    如果不想自己输入,可以直接下载附件(https://files.cnblogs.com/lansh/126.com.rar)~~,下载完毕以后,需要解压出126.com.js文件。

    具体的安装方法是:

    1.首先安装WebMail Notifier

    2.打开WebMail Notifier的属性(Preferences),选择“WebMail Accounts” -> "User Script"

    3.单击“Add”按钮,选择你刚才下载的这个JavaScript脚本文件,选择“Open”,即安装完毕。

    4.选择126.com类型,设置你的126的邮件账号即可。

    /***********************************************************
    126.com
    **********************************************************
    */
    function initHandler(handler){
        handler.name
    ="126.com";
      handler.loginData
    =["https://entry.mail.126.com/cgi/login?redirTempName=https.htm&hid=10010102&lightweight=1&verifycookie=1&language=0&style=-1&domain=126.com&language=0&bCookie=&style=23&remUser=&secure=&enter.x=%B5%C7+%C2%BC",
                          
    "user","pass",""];

      handler.process
    =function (aHttpChannel, aData) {
        
    switch(this.stage){
        
    case ST_LOGIN_RES:
            
    var fnd = aData.match(/window\.location\.replace\("(.+?)"\);/);
            
    if(!fnd){
            
    this.onError();
            
    return true;
            }
          
    var url=fnd[1];
          
    if(url && url.indexOf("mail.126.com")!=-1){
              handler.mailURL 
    = url;
              handler.dataURL
    =url.substring(0,url.indexOf("mail.126.com")+12);
              handler.dataURL 
    += "/a/p/servdata.html?"+url.substring(url.indexOf("sid="));
              
    this.stage=ST_DATA;
          }
    else{
            
    this.onError();
              
    return true;
          }
          
    break;
        }
        
    return WebMailHandler.prototype.process.call(this,aHttpChannel, aData);
      }

      handler.getData
    =function(aData){
        
    var num=0;
        
    var fnd=aData.match(/<int name="unreadMessageCount">(\d+)<\/int>/);
        if(fnd){
            num
    =parseInt(fnd[1]);
        }
    else{
            
    return -1;
        }
        
    return num;
      };
      handler.onError
    =function(desc){
        
    this.stage=this.initStage;
        
    this.webMailNotifier.setState(this.id,this.user,nsIWebMailNotifier.ST_RESET);
      }
    }
  • 相关阅读:
    springMVC(注解版笔记)
    关于在Eclipse里面启动了服务,但是localhost:8080无法访问的问题:
    springmvc基础知识
    private
    hashtable,hashMap,vector和ArrayList
    使用IDEA创建java项目(hello word)
    设计模式
    设计模式(总纲)
    spring-boot集成PageHelper和通用Mapper
    spring-boot集成mybatis
  • 原文地址:https://www.cnblogs.com/lansh/p/1320665.html
Copyright © 2011-2022 走看看