Warning: fopen(/www/sites/update.greasyfork.icu/index/store/forever/915f1934b70321e3c21dcfea0af1b51e.js): failed to open stream: No space left on device in /www/sites/update.greasyfork.icu/index/scriptControl.php on line 65
// ==UserScript==
// @name web.de: Direkt zum Posteingang
// @description Klickt den "E-Mail" button.
// @namespace johnny_english
// @include *navigator.web.de/*
// @grant none
// @version 1
// @downloadURL none
// ==/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 x = document.getElementsByTagName( "pos-icon-item" );
for( j = 0; j < x.length; ++j ){
if( // right after login, the attr "style" is not present
! x[j].hasAttribute( "style" ) &&
x[j].hasAttribute( "url" ) &&
x[j].getAttribute( "url" ) == "./mail" ){
// stop and dispose the particular timer for this MO
window.clearTimeout( tmr );
// click on Posteingang
x[j].getElementsByTagName( "a" )[0].click();
// stop and dispose this particular MO
thisMO.disconnect();
break;
}
}
}
).observe( document, {
childList: true,
subtree: true
} );