Greasy Fork

来自缓存

Greasy Fork is available in English.

Gmail POP3 Auto Check Now

Automatic Google Mail POP3 check now operation.

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name           Gmail POP3 Auto Check Now
// @author         José David Jurado Alonso
// @version        1.0.0
// @description    Automatic Google Mail POP3 check now operation.
// @license MIT
// @include        /^https?://mail\.google\.com//
// @match          https://mail.google.com/*
// @match          http://mail.google.com/*
// @grant          none
// @namespace http://greasyfork.icu/users/239938
// ==/UserScript==

// ==OpenUserJS==
// @author jdzuri
// ==/OpenUserJS==

(function () {

  var first_check_delay = 20 // seconds
  var interval = 120; // seconds
  var text = "Comprobar si tengo correo ahora";

  var debug = false;

  function log(msg) {
    debug && console.log(msg);
  }

  function checkPop3() {
    var els = document.body.getElementsByTagName("span");
    for (var i = 0; i < els.length; i++) {
      var el_role = els[i].getAttribute("role");
      var el_text = els[i].textContent;
      if (el_role === "link" && el_text === text) {
        els[i].click();
        log("[checkPop3] checking now!!");
        break;
      }
    }
  }

  setTimeout(checkPop3, first_check_delay * 1000);
  setInterval(checkPop3, interval * 1000);

})();