isChrome()
truewhen the current environment is Google Chrome — or any browser built directly on Chromium (Chrome Beta, Canary, Brave, Vivaldi, …) — but not Chromium-Edge or Opera.
| Signature | (options?: DetectOptions) => boolean |
| Tree-shakes to | ~400 bytes if imported alone |
| Excludes | Edge, Opera, Firefox-on-iOS, Safari, IE |
Matches
- Desktop Chrome —
Chrome/token withnavigator.vendor === 'Google Inc.'(orwindow.chromeglobal as a UA-spoof backstop). - Chrome iOS —
CriOS/token. - Pure Chromium —
Chromium/token (Brave, Vivaldi, etc.).
Excludes UAs containing Edge/, Edg/, EdgA/, EdgiOS/, Opera, or OPR/.
Examples
- Default
- SSR
- Combined with isMobile
- Brave / Chromium siblings
import { isChrome } from 'get-browser';
if (isChrome()) {
// safe to use Chrome-only APIs guarded by feature checks
enableChromeFeature();
}
import { isChrome } from 'get-browser';
isChrome({
userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) '
+ 'AppleWebKit/537.36 Chrome/140.0.0.0 Safari/537.36',
vendor: 'Google Inc.',
}); // → true
import { isChrome, isMobile } from 'get-browser';
// Chrome Android — common quirks live here
if (isChrome() && isMobile()) {
document.body.classList.add('chrome-android');
}
import { detect } from 'get-browser';
// Brave & Vivaldi both report as 'chrome' — they're pure Chromium underneath.
// The library does NOT distinguish them. Use the Brave-specific
// navigator.brave API for that.
const isBrave = await navigator.brave?.isBrave?.() ?? false;
const family = detect(); // 'chrome'
Pure-Chromium fingerprint
Chrome/-with-Apple-vendor on iOS is not desktop Chrome — it's Chrome iOS, which uses WebKit under the hood. isChrome() returns true for both, but they have very different capabilities.