Search Docs
getBrowserType
Detects and returns the current browser type based on parsed user agent information.
import { getBrowserType } from 'funtool'; // Get current browser type const browser = getBrowserType(); // Possible returns: 'Chrome', 'FireFox', 'Edge', 'Safari', 'IE11', etc. // Browser-specific logic if (getBrowserType() === 'IE11') { // Apply IE11-specific fixes }
function getBrowserType(): BrowserType type BrowserType = | 'IE7' | 'IE8' | 'IE9' | 'IE10' | 'IE11' | 'Edge' | 'FireFox' | 'Opera' | 'Chrome' | 'Safari' | null;
Returns one of the browser types or null if detection fails.
parseUA