diff --git a/src/index.ts b/src/index.ts index 52624c4..53bb5b8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,6 +4,14 @@ import * as elementCheckVisibility from './element-checkvisibility.js' import * as navigatorClipboard from './navigator-clipboard.js' import * as requestIdleCallback from './requestidlecallback.js' +let supportsModalPseudo = false +try { + // This will error in older browsers + supportsModalPseudo = document.body.matches(':modal') === false +} catch { + supportsModalPseudo = false +} + export const baseSupport = typeof globalThis === 'object' && // ES2019 @@ -26,6 +34,7 @@ export const baseSupport = // DOM / HTML and other specs typeof queueMicrotask === 'function' && typeof HTMLDialogElement === 'function' && + supportsModalPseudo && typeof AggregateError === 'function' && typeof BroadcastChannel === 'function' && 'randomUUID' in crypto &&