Greasy Fork is available in English.

mailinator notification

Show desktop notification and play sound when there is new mail

// ==UserScript==
// @name        mailinator notification
// @match       https://www.mailinator.com/inbox.jsp?*
// @description Show desktop notification and play sound when there is new mail
// @version     0.2
// @grant       none
// @namespace   https://greasyfork.org/users/4947
// ==/UserScript==

Notification.requestPermission();

angular.element(document).ready(function(){

  var audio = new Audio('data:audio/ogg;base64,T2dnUwACAAAAAAAAAADUONFWAAAAANAQVSEBHgF2b3JiaXMAAAAAAYC7AAAAAAAAAHcBAAAAAAC4AU9nZ1MAAAAAAAAAAAAA1DjRVgEAAABsBw/cEC3//////////////////8kDdm9yYmlzHQAAAFhpcGguT3JnIGxpYlZvcmJpcyBJIDIwMDcwNjIyAAAAAAEFdm9yYmlzKUJDVgEACAAAADFMIMWA0JBVAAAQAABgJCkOk2ZJKaWUoSh5mJRISSmllMUwiZiUicUYY4wxxhhjjDHGGGOMIDRkFQAABACAKAmOo+ZJas45ZxgnjnKgOWlOOKcgB4pR4DkJwvUmY26mtKZrbs4pJQgNWQUAAAIAQEghhRRSSCGFFGKIIYYYYoghhxxyyCGnnHIKKqigggoyyCCDTDLppJNOOumoo4466ii00EILLbTSSkwx1VZjrr0GXXxzzjnnnHPOOeecc84JQkNWAQAgAAAEQgYZZBBCCCGFFFKIKaaYcgoyyIDQkFUAACAAgAAAAABHkRRJsRTLsRzN0SRP8ixREzXRM0VTVE1VVVVVdV1XdmXXdnXXdn1ZmIVbuH1ZuIVb2IVd94VhGIZhGIZhGIZh+H3f933f930gNGQVACABAKAjOZbjKaIiGqLiOaIDhIasAgBkAAAEACAJkiIpkqNJpmZqrmmbtmirtm3LsizLsgyEhqwCAAABAAQAAAAAAKBpmqZpmqZpmqZpmqZpmqZpmqZpmmZZlmVZlmVZlmVZlmVZlmVZlmVZlmVZlmVZlmVZlmVZlmVZlmVZQGjIKgBAAgBAx3Ecx3EkRVIkx3IsBwgNWQUAyAAACABAUizFcjRHczTHczzHczxHdETJlEzN9EwPCA1ZBQAAAgA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v3l0OLupDOvTY1ixCszkZtnxHr5WScmVexCiNrbGoVoggK7S2f++a1WKv1FpXjNoXYaMQJgHK3XIWoouOy+UAEAN6FnIIu9YGEHaDKaaTWgPR7AAB7egCAztOyn1hlGUgAD5MTbWkBKp2EIjWWiOm4lFSRQO9QJ2gDALiOAQN0niZdsVDQAK4oNDBLLNwW2FRFJm5oK+PuUOMyh87Qs2+VYMWrHcm0GWT/wX+DWuo6ctl1jDnbxMT6fbOYqSHzpm3PZi7RJIepAfZVx0iBkBO1sr1H2TQKltrWc9Gpq0IG5i6HjYeaTbs51Y5t3c6UZ1/QlwA+hjysKumBlRF1QqgltUak3wMA2OsCoNF2Ur5srLIMJIBfB4I9Vh6UAlSDA1FEYXUhjDDBfJs+sQIAknqyApAAZvN3AysHvUYhGNW1nEW7nHT4xlKBpAUQikFZzf6zyrjKtl8HAwrxQAcv3t0S03vPGFqZA9ovysqQYHPRA53SSao2peYVmTFnXywgzZ4FfAf1VrUlVxRPOc2xuGOqqSZ7bS4Ra/TrwKzpcg9qxG9VAp60Xb7xcYjkAU9nZ1MABJ/hAAAAAAAA1DjRVgQAAAD3YCiFAaO+hTyC9t1B2gNJtkvNpN8AEBgTX5aLqKICAMBDncCYEWectStb0u+5VFcngGPdPvLXZ8aFJHfkmhwvURRNJO3P/oUtgslTM5+BRaeAnXCwjvk0AAIglX+M4Z68CN7EmDwuSusC03P+StRNk5JS8oagOCFpbmJa/hdasERyjr+uAScsrcuShUBXuwcZmLpPFDAtEUBRttqyU8u8hTG8BkwtMNAA');
  var inboxCtrl = document.getElementById('InboxCtrl');
  var $scope = angular.element(inboxCtrl).scope();

  function spawnNotification(theBody,theTitle) {
    var options = {
      body: theBody
    };
    var n = new Notification(theTitle,options);
  }

  $scope.$watch('emails', function(newEmails, oldEmails){
    if(newEmails.length > oldEmails.length){
      var email = newEmails[0];
      var body = email.from;
      var title = email.subject;
      spawnNotification(body, title);
      audio.play();
    }
  }, true);

});