Skip to content

Instantly share code, notes, and snippets.

@sakupi01
Created October 18, 2025 12:16
Show Gist options
  • Select an option

  • Save sakupi01/a3fa9b025213e1e56444299d29bf7aaf to your computer and use it in GitHub Desktop.

Select an option

Save sakupi01/a3fa9b025213e1e56444299d29bf7aaf to your computer and use it in GitHub Desktop.
Baseline Browser Compatible Version
import { getCompatibleVersions } from 'baseline-browser-mapping';
// Automatically fetch the latest Baseline Widely Available browser versions
const compatibleVersions = await getCompatibleVersions();
// Check if the current browser meets Baseline criteria
function shouldShowWarning(userAgent) {
const browserInfo = parseUserAgent(userAgent);
return browserInfo.version < compatibleVersions[browserInfo.name];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment