If this is red, JavaScript says this is Microsoft Edge. [THIS WORKS IN FALL 2022]
<style>
  
.msedge_jstest {
  background-color:#ccc;
  color:#fff;
}

.msedge_js {
  background-color:#f00;
  color:#fff;
}

</style>

 

  
<div id="my_test_div" class="msedge_jstest">If this is red, JavaScript says this is Microsoft Edge. [THIS WORKS IN FALL 2022]</div>
  

 

<script>

if (/Edg/.test(navigator.userAgent) && /Windows/.test(navigator.userAgent)) 
{
  document.getElementById("my_test_div").classList.add("msedge_js");
}

</script>