Detect WebKit-Based Browsers from User-Agent
Identify WebKit-based browsers from User-Agent strings. Learn to distinguish true WebKit (Safari) from Blink (Chrome) which also reports as WebKit.
Detailed Explanation
Detecting WebKit Browsers
WebKit is the open-source rendering engine originally developed by Apple for Safari. Identifying true WebKit browsers versus Blink browsers that report as WebKit is a common challenge.
The WebKit Lineage
KHTML (Konqueror) → WebKit (Safari) → Blink (Chrome)
When Google forked WebKit to create Blink in 2013, Chrome kept the AppleWebKit/537.36 token for compatibility. This means both true WebKit browsers (Safari) and Blink browsers (Chrome, Edge, Opera) include AppleWebKit in their UA.
Distinguishing WebKit from Blink
True WebKit (Safari):
AppleWebKit/605.1.15 ... Version/17.2 Safari/605.1.15
- WebKit version: 605.x (active development, version changes)
- Includes
Version/token - No
Chrome/token
Blink (Chrome-based):
AppleWebKit/537.36 ... Chrome/120.0.0.0 Safari/537.36
- WebKit version: 537.36 (frozen, never changes)
- Includes
Chrome/token - No
Version/token
Detection Algorithm
1. If UA contains "Chrome/" → Blink engine
2. If UA contains "Version/" AND "Safari/" → WebKit engine
3. If UA contains "AppleWebKit/" with no "Chrome/" → WebKit engine
4. If UA contains "Gecko/" → Gecko engine (Firefox)
iOS: All Browsers Are WebKit
On iOS, Apple requires all browsers to use the WebKit rendering engine. This means:
- Chrome on iOS (CriOS) → WebKit
- Firefox on iOS (FxiOS) → WebKit
- Edge on iOS (EdgiOS) → WebKit
Only on iOS, UA parsing cannot determine the actual rendering behavior differences between browsers, because they all share the same engine.
WebKit-Specific Features
Some features are WebKit-only or behave differently in WebKit:
- JPEG XL support (Safari 17+, not in Chrome)
-webkit-prefixed CSS properties- Different ScrollTimeline API behavior
- Different implementation of the Web Push API
- Intelligent Tracking Prevention (ITP)
Future: Web Engine Diversity
There is ongoing discussion about Apple's iOS browser engine restriction. If Apple allows alternative engines on iOS (as mandated by the EU's Digital Markets Act), UA parsing for engine detection on iOS will become more important.
Use Case
Front-end developers detect WebKit browsers to apply Safari-specific CSS workarounds and to feature-gate APIs that behave differently in WebKit vs. Blink. Testing teams use engine detection to organize cross-browser test matrices by rendering engine rather than individual browser brand.