油猴-189邮箱邮件提醒

版权声明: https://blog.csdn.net/qq_27469815/article/details/83312770
// ==UserScript==
// @name         mailRemind
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       axing
// @match        https://webmail30.189.cn/*
// @grant        none
// @requite       https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js
// ==/UserScript==
(function() {
//     var unread_num=prompt('请输入未读邮件数:','230')
    var time_out=5*60000 //5分钟刷新一次
    var interval = setInterval(function(){
        var maillist = document.getElementById("maillist-1");
        var unread_mail=maillist.innerText.split("(")[1].split(")")[0];
        if (unread_mail != 230){
            clearInterval(interval);
            var title = document.getElementsByTagName("title")[0]
            setInterval(function(){
             setTimeout(function(){title.innerText = '[^-^]';},1000);
             setTimeout(function(){title.innerText = '[有新邮件了]';},2000);
            },1000);
        }else{
        window.location.reload();
        }
    },
                time_out);
})();

刷新邮箱,读取未读邮件数量,与设定值对比,如果不一样则在标签上提醒。那么问题来了,目前设定值要进入代码修改,这不方便。我想读取本地文本文件,但目前没有好的方法。有谁知道?

猜你喜欢

转载自blog.csdn.net/qq_27469815/article/details/83312770
今日推荐