Javascript Browser Navigator appCodeName Property get

Introduction

Get the code name of your browser:

var x = "Browser CodeName: " + navigator.appCodeName;

Click the button to display the code name of your browser.

View in separate window

<!DOCTYPE html>
<html>
<body>
<button onclick="myFunction()">Test</button>

<p id="demo"></p>

<script>
function myFunction() {//ww w  .j  av a  2  s  .  c  om
  var x = "Browser CodeName: " + navigator.appCodeName;
  document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>

The appCodeName property returns the code name of the browser.

All modern browsers returns "Mozilla", for compatibility reasons.

This property is read-only.




PreviousNext

Related