trustvote / Entire Balance

// ==UserScript==
// @version   			149
// @name         Entire Balance
// @description  Press F on send-transaction step to count fee and input entire balance are able to send at myetherwallet.com.
// @namespace   Press_F_TO_Entire_Balance
// @author      lfj.io
// @copyright   Press_F_TO_Entire_Balance
// @icon       https://www.myetherwallet.com/favicon.png
// @compatible        chrome Chrome_70.0.2490.86 + Violentmonkey
// @compatible        firefox Firefox_69.0 + Violentmonkey
// @compatible        opera Opera_55.0.1990.115 + Violentmonkey
// @compatible        safari 7.0.3 + Violentmonkey
// @compatible        macintosh 10_9_3 + Violentmonkey
// @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt
// @copyright   LFJ
// @author       LFJ_IO
// @include		  *://*.myetherwallet.com/*
// @grant         unsafeWindow
// @grant         window.close
// @grant         window.open
// @grant         window.focus
// @noframes
// @noframe
// @change-log  Improved pornhub
// @run-at      document-body
// ==/UserScript==
/* String Prototype */
// Press F on send-transaction step to count fee and input entire balance are able to send
var PartLFJ = {
    myetherwallet_com: function(){
      
      var addEvent = document.addEventListener ? function(target,type,action){
          if(target){
              target.addEventListener(type,action,false);
          }
      } : function(target,type,action){
          if(target){
              target.attachEvent('on' + type,action,false);
          }
      }

      addEvent(document,'keydown',function(e){
          e = e || window.event;
          var key = e.which || e.keyCode;
          if(key===70){
           if(document.querySelector('.the-form.amount-number input[name="value"]')){document.querySelector('.the-form.amount-number input[name="value"]').value=(parseFloat(document.querySelector('.information-container .balance-text-container .balance-text p').innerText.replace(' ETH',''))-parseFloat(document.querySelector('.fee-value .usd span').innerText));}
          }

      });
      
      
    },
init: function () {
    	this.url = location.href;
		this.myetherwallet_com();

    }
   
};



var LFJ = {
      init:async function () {
            PartLFJ.init();
    }
}
//________________________________________________________________________
LFJ.init();