gmx.net: Direkt zum Posteingang

Klickt den "E-Mail"-Button nach Login.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         gmx.net: Direkt zum Posteingang
// @namespace    johnny_english
// @version      2.4.2
// @description  Klickt den "E-Mail"-Button nach Login.
// @author       Johnny English, Graphen
// @include      /^https?://(bap\.)?navigator\.gmx\.(net|ch|at)/.*$/
// @icon         https://img.ui-portal.de/gmx/favicon.ico
// @grant        none
// @noframes
// @run-at       document-start
// ==/UserScript==

// MIT-licence:
// Copyright (c) 2017 Johnny English


// parallel AJAX disallows plain match after "document-end" (equivalent
// document.onreadystatechange ... document.readyState === 'complete')
new MutationObserver(
  // Array, MutationObserver
  function( mutations, new_observer ) {
    var thisMO = this;

    // there are 4+ iframes, each with its MO
    var tmr = window.setTimeout( function(){
      thisMO.disconnect();
    }, 2000 );

    // searching through mutations wasn't reliable for some reason
    var j, x = document.getElementsByTagName( "atl-menu-item" );
    for( j = 0; j < x.length; ++j ){
      if( x[j].hasAttribute( "data-item-name" ) &&
          x[j].getAttribute( "data-item-name" ) == "mail" ){
        // stop and dispose the particular timer for this MO
        window.clearTimeout( tmr );
        // click on Posteingang
        x[j].click();
        // stop and dispose this particular MO
        thisMO.disconnect();
        break;
      }
    }
  }
).observe( document, {
  childList: true,
  subtree: true
} );