JavaScript Navigator appCodeName Property

Beginner
5 min read
Updated: Nov 2026
3 examples
Property

Definition

navigator.appCodeName is a read-only string that is always "Mozilla" in any browser (MDN). It is kept only for compatibility with very old scripts.

Read the notes below before you rely on this property. Prefer feature detection when support is limited.

Syntax

Use navigator.appCodeName. Start with this line.

JavaScript
navigator.appCodeName
CallWhat it does
navigator.appCodeNamePrimary signature.

Built into the browser. Read navigator.appCodeName on Navigator — no import required.

Library declarations
JavaScript
navigator.appCodeName

Parameters

This member has no parameters beyond those shown in the signature.

Return Value

Return ValueDescription
*The current value of navigator.appCodeName.

JavaScript Examples

Example 1 — Read appCodeName

Log the compatibility string from navigator.

JavaScript
console.log(navigator.appCodeName); // "Mozilla"
Try It Yourself

How It Works

  1. Access navigator. The browser exposes environment info on navigator.
  2. Read the property. appCodeName is a string getter.
  3. See the value. MDN: it is always "Mozilla".
  4. No side effects. Reading it does not change the browser or page.

Example 2 — Prove It Is Always Mozilla

Compare the value to the string MDN documents.

JavaScript
const name = navigator.appCodeName;
console.log(name);
console.log(name === "Mozilla"); // true in every browser
Try It Yourself

How It Works

  1. Store the string. Capture appCodeName once.
  2. Strict compare. Check equality with "Mozilla".
  3. Result. The comparison is true across engines.
  4. Lesson. You cannot tell browsers apart with this check.

Example 3 — Feature Detect Instead

Prefer capability checks over reading compatibility names.

JavaScript
// Avoid: if (navigator.appCodeName === "Mozilla") { … }

if ("geolocation" in navigator) {
  console.log("geolocation available");
} else {
  console.log("geolocation missing");
}
Try It Yourself

How It Works

  1. Skip sniffing. Do not branch on appCodeName.
  2. Ask for the API. in checks whether geolocation exists.
  3. Branch on capability. Enable or disable that feature only.
  4. Rule. Detect what you need; do not guess the browser brand.

Browser Support

navigator.appCodeName is marked Baseline Widely available on MDN (since July 2015). Support is universal — the value is always "Mozilla".

✓ Baseline · Widely available

Navigator.appCodeName

Read-only string that always returns "Mozilla". Available everywhere for compatibility; not useful for identifying browsers.

100% Widely available
Google Chrome All versions · Desktop & Mobile
Full support
Mozilla Firefox All versions · Desktop & Mobile
Full support
Apple Safari All versions · macOS & iOS
Full support
Microsoft Edge All versions · Chromium & Legacy
Full support
Internet Explorer IE 6+ · Legacy environments
Full support
Opera All modern versions
Full support
appCodeName Excellent

Bottom line: Safe to read for demos and legacy understanding. Never use it for browser detection — prefer feature detection for real product decisions.

Frequently Asked Questions

In every modern browser it returns the string "Mozilla". The property exists only for historical compatibility with very old scripts.
No. MDN warns not to rely on it for a real product name. Chrome, Edge, Safari, Firefox, and others all report "Mozilla".
Early browsers pretended to be Mozilla so sites that sniffed user-agent strings would still work. appCodeName kept that compatibility habit.
No. It is a read-only Navigator property. You read it; you do not assign a new value.
Prefer feature detection (for example "geolocation" in navigator or CSS/API checks) over reading appCodeName, appName, or brittle user-agent parses.
MDN does not mark it Deprecated — it is Baseline Widely available and kept for compatibility. Still, do not use it to identify browsers.

Next: appName

Learn the related Navigator appName compatibility property.

appName tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful