Greasy Fork

QQ邮箱 显示下次扩容时间

try to take over the world!

目前为 2020-11-19 提交的版本。查看 最新版本

// ==UserScript==
// @name         QQ邮箱 显示下次扩容时间
// @namespace    http://tampermonkey.net/
// @version      0.1.2
// @description  try to take over the world!
// @author       luofo
// @match        *://mail.qq.com/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';
    let c = setInterval(function() {
        if (window.frames["mainFrame"] && window.frames["mainFrame"].document.querySelector(".addrtitle b")) {
            var node = window.frames["mainFrame"].document.querySelector(".addrtitle");
            var selectNode = window.frames["mainFrame"].document.querySelector(".addrtitle b");
            var num = selectNode.textContent.match(/([0-9]{1,4})/g).toString();
            var newNode = document.createElement('div');
            newNode.innerHTML = "下次扩容时间:" + new Date(Date.parse(new Date(num)) + 7776000000).toLocaleDateString();
            node.appendChild(newNode);
            clearInterval(c);
        } else {
            return
        }
    },1000)
    // Your code here...
})();