encyclopegia.org

Feature detection (web development)

Feature detection (also feature testing) is a technique used in web development for handling differences between runtime environments (typically web browsers or user agents), by programmatically testing for clues that the environment may or may not offer certain functionality.[src] This information is then used to make the application adapt in some way to suit the environment: to make use of certain APIs, or tailor for a better user experience.[src] Its proponents claim it is more reliable and future-proof than other techniques like user agent sniffing and browser-specific CSS hacks.[src]

Feature detection (also feature testing) is a technique used in web development for handling differences between runtime environments (typically web browsers or user agents), by programmatically testing for clues that the environment may or may not offer certain functionality.[src] This information is then used to make the application adapt in some way to suit the environment: to make use of certain APIs, or tailor for a better user experience.[src] Its proponents claim it is more reliable and future-proof than other techniques like user agent sniffing and browser-specific CSS hacks.[src] ==Techniques== A feature test can take many forms.[src] It is essentially any snippet of code which gives some level of confidence that a required feature is indeed supported.[src] However, in contrast to other techniques, feature detection usually focuses on performing actions which directly relate to the feature to be detected, rather than heuristics.[src] In CSS, the at-rule @supports introduced in 2015 allows to test if a given feature is supported.[src] For instance the following code activates the declarations only if the user agent supports display: flex : @supports (display: flex) { .container { display: flex; } } ==Undetectables== Some browser features are considered undetectable, because no clues are known to give sufficient confidence that a feature is supported.[src] These are often because of limited information available to the JavaScript environment in the browser; generally features must be exposed via the DOM in some way in order to be detectable using JavaScript.[src] When undetectables are encountered, it is common to turn to user agent sniffing as an alternative mechanism, or to employ defensive coding to minimise the impact if the feature turns out not to be supported.[src] The Modernizr project maintains a record of known undetectables on their wiki.[src] ==See also== Browser sniffing Progressive enhancement Modernizr ==References==[src]

15 sentences · 15 cited inline · 0 references stored

References

No reference rows published for this article.

Cite this article

MLA

"Feature detection (web development)." encyclopegia.org, 2026, https://encyclopegia.org/wiki/feature-detection-web-development. Accessed 30 November 2026.

Chicago

"Feature detection (web development)." encyclopegia.org. Accessed November 30, 2026. https://encyclopegia.org/wiki/feature-detection-web-development.

APA

encyclopegia.org. (2026). Feature detection (web development). Retrieved November 30, 2026, from https://encyclopegia.org/wiki/feature-detection-web-development

Accessed November 30, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

Contradiction Detection

article · references available

web server

stub · references available

feature film

stub · references available

web beacon

stub · references available

web syndication

stub · references available

web development

stub · references available

comparison of server-side web frameworks

stub · references available

network intrusion detection system

stub · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1351360391 · 0.5 · snapshot enwiki-001351360391

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools
  • Careers — open roles: frontier engineers and sales partners
  • Index — every corpus, paper and record
  • Estate guide — what a public data estate is
  • Founder — Lois-Kleinner Alpasan
  • Records — DOIs and external deposits
  • Documents — one-pagers, PDFs and QR codes
  • Brand kit — logos and share images
  • Papers — plain-language briefs with citations
  • Browser — search engine, PWA and bookmarklet
  • Anticloud — the operator and its projects

As seen in Business Insider · 336 outlets · evidence DOIs · plain-language papers

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.