jQuery .browser Property

Beginner
6 min read
Updated: Oct 2026
4 examples
Live preview

What Is jQuery.browser?

jQuery.browser (alias $.browser) was a plain object of flags read from navigator.userAgent — browser class booleans plus $.browser.version for the rendering engine (added in jQuery 1.0 / 1.1.3).

Remember
$.browser          → { msie, mozilla, webkit, opera, … }
$.browser.version  → "engine version string"

// Typical legacy flags:
$.browser.msie
$.browser.mozilla
$.browser.webkit   // since 1.4
$.browser.opera
$.browser.safari   // deprecated flag

// Modern jQuery 1.9+ / 3.x:
typeof $.browser   → "undefined"  (unless Migrate)
NeedUse
Read legacy code$.browser.msie / .webkit (≤ 1.8 or Migrate)
CSS capabilityCSS.supports()
Feature tests (legacy jQuery)$.support (also legacy)

How to Use jQuery.browser (Legacy)

Only for reading old code — do not add new UA sniffing.

  1. Confirm you are on jQuery ≤ 1.8, or load jQuery Migrate with 1.9+.
  2. Read a flag such as $.browser.webkit or $.browser.msie.
  3. Optionally read $.browser.version for the engine version string.
  4. Plan a rewrite: replace the branch with a real feature / capability check.
PieceRequired?Role
$.browserYes (legacy)Flags object from the user agent
$.browser.versionOptionalRendering engine version string
Modern pathPreferredFeature detection, not browser names

Pseudocode

Pseudocode
// Legacy (removed in jQuery 1.9):
ua = navigator.userAgent
$.browser = parse flags from ua   // msie / mozilla / webkit / opera
$.browser.version = engine version string

if $.browser.webkit:
    // old browser-specific branch
else if $.browser.msie:
    // another branch

// Modern replacement idea:
if CSS.supports("display", "flex"):
    use flex layout
if typeof fetch === "function":
    use fetch API

Cheat Sheet

Keep these facts handy while reading legacy jQuery browser sniffing.

TopicDetail
SyntaxjQuery.browser / $.browser
SincejQuery 1.0 (version: 1.1.3)
StatusDeprecated 1.3 · removed 1.9
Flagsmsie, mozilla, webkit, opera, safari*
Version$.browser.version (engine string)
Sourcenavigator.userAgent (spoofable)
RestorejQuery Migrate plugin only

* safari flag was itself deprecated in favor of webkit.

Live Preview

This widget loads jQuery 1.12.4 so $.browser still exists. Pick a flag to inspect.

Legacy demo via jQuery 1.12.4 — removed from jQuery 1.9+ without Migrate.

Result
Loading jQuery 1.12.4…

jQuery Examples

Examples 1–3 use jQuery 1.12.4 so $.browser works. Example 4 shows the modern path with jQuery 3.x.

Example 1 — Official: List $.browser Flags

Dump every key on the browser object (jQuery API sample).

jQuery
// Requires jQuery ≤ 1.8 or 1.12 + browser present
jQuery.each(jQuery.browser, function (i, val) {
  console.log(i + " : " + val);
});
Try It Yourself

How It Works

  1. Object. jQuery.browser holds the parsed flags.
  2. Each. jQuery.each walks every key/value pair.
  3. Print. Log name : value for msie/mozilla/webkit/opera/version.
  4. Note. Exact flags depend on the current user agent.

Example 2 — Official: msie and version

Check Internet Explorer and read the engine version string.

jQuery
console.log($.browser.msie);     // true only on old IE UA
console.log($.browser.version);  // engine version string

if ($.browser.msie) {
  console.log("IE engine: " + $.browser.version);
}
Try It Yourself

How It Works

  1. Flag. $.browser.msie is true only when the UA looks like IE.
  2. Version. $.browser.version is always a string when $.browser exists.
  3. Branch. Old plugins often gated IE-only fixes behind this flag.
  4. Caveat. Compatibility View made IE lie about its version.

Example 3 — Official: WebKit Conditional

Alert-style branch for WebKit browsers (Chrome/Safari family UA).

jQuery
if ($.browser.webkit) {
  console.log("This is WebKit!");
} else {
  console.log("Not WebKit");
}
Try It Yourself

How It Works

  1. Flag since 1.4. webkit replaced older Safari-centric sniffing.
  2. Branch. True when the UA reports a WebKit engine family.
  3. Message. Print a short status for debugging legacy code.
  4. Migrate. Prefer testing the feature you need, not “is WebKit?”.

Example 4 — Modern Replacement (jQuery 3.x)

$.browser is gone — detect capabilities instead.

jQuery
console.log(typeof $.browser);  // "undefined" in jQuery 3.x

var flex = window.CSS && CSS.supports("display", "flex");
var hasFetch = typeof fetch === "function";

console.log("flexbox: " + flex);
console.log("fetch: " + hasFetch);
Try It Yourself

How It Works

  1. Missing API. On jQuery 3.x, typeof $.browser is "undefined".
  2. CSS test. CSS.supports answers “can I use flex?” without naming the browser.
  3. API test. Check fetch (or any feature) the same way.
  4. Rule. Capability checks survive new browsers; UA sniffing does not.

Edge Cases & Pitfalls

Check these before relying on any user-agent sniff in plugins.

removed

Gone since jQuery 1.9

Accessing $.browser on modern jQuery throws or returns undefined. Use Migrate only as a temporary bridge.

spoof

User agents lie

Browsers and users can spoof navigator.userAgent. Never trust name sniffing for security or critical behavior.

ie

IE Compatibility View

IE8 in Compat View claimed to be 7. Version strings from $.browser.version were often wrong.

safari

safari flag is deprecated

Prefer the webkit flag in legacy code — and prefer feature tests in new code.

Browser Support

jQuery.browser existed in jQuery 1.0–1.8 (deprecated from 1.3). It was removed in jQuery 1.9 and is absent from jQuery 2.x/3.x unless you load jQuery Migrate.

✓ Removed · jQuery 1.9

jQuery.browser

Only in jQuery 1.0–1.8 (or Migrate). Modern Chrome/Firefox/Safari/Edge with jQuery 3.x do not expose $.browser. Prefer feature detection.

Legacy jQuery ≤ 1.8 only
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
$.browser Removed 1.9+

Bottom line: Do not use $.browser in new projects. Read it only in legacy code, restore temporarily with Migrate, then switch to feature detection.

Performance Notes

ApproachCostBest for
$.browser.*O(1) readLegacy code only
CSS.supports(...)O(1)CSS capability checks
"fetch" in windowO(1)API availability checks

Speed is not the problem — correctness is. Feature tests stay valid as browsers change; UA sniffing does not.

Key Takeaways

  • Role: legacy UA flags + $.browser.version.
  • Status: deprecated 1.3, removed 1.9.
  • Risk: spoofable user-agent strings.
  • Replace with: feature detection (CSS.supports, API checks).

One line: learn $.browser to read old jQuery — ship feature detection, not user-agent sniffing.

Frequently Asked Questions

jQuery.browser was a plain object of Boolean flags parsed from navigator.userAgent — msie, mozilla, webkit, opera, and the deprecated safari flag. jQuery.browser.version held the rendering engine version string. Added in jQuery 1.0.
No in stock jQuery 1.9+. It was deprecated in 1.3 and removed in 1.9. jQuery 3.x does not include $.browser unless you load the jQuery Migrate plugin, which restores it for legacy code.
User-agent sniffing is unreliable — strings can be spoofed, compatibility modes lie, and new browsers break if/else chains. jQuery recommends feature detection instead of browser names.
A string reporting the rendering engine version from the user agent (for example Gecko for Firefox). It was removed with $.browser in 1.9 and has the same spoofing problems as the flags.
$.browser guessed the browser from the user-agent string. $.support ran feature tests for DOM/CSS quirks. Prefer feature detection for new code; treat both as legacy APIs when reading old tutorials.
Detect capabilities: CSS.supports() for CSS, "fetch" in window for APIs, and progressive enhancement. Use jQuery Migrate only while rewriting old plugins that still sniff $.browser.

Next: jQuery.error()

Learn how jQuery throws a named error for plugin authors.

jQuery.error 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