为什么用户中止在firefox中停止服务器脚本执行?

Following (php) script does not write data to file when triggered by XmlHttpRequest from FIREFOX, but it works from CHROME and EDGE - any idea why?

<script>

  var xhttp = new XMLHttpRequest();
  xhttp.open("GET", "?data=test", true);
  xhttp.send();
  location.href = "https://www.google.com";

</script>

<?php

  if(isset($_GET["data"]) === true)
  {
    ignore_user_abort(true);

    file_put_contents(__DIR__ . DIRECTORY_SEPARATOR . "file.txt", $_GET["data"]);
  }

?>