mirror of
https://github.com/supabase/supabase.git
synced 2026-10-08 02:45:07 +03:00
Docs owned the only warn-mode implementation, so WWW and Studio would each have copied it. Move the reusable half into e2e/shared: the scan-result envelope, the annotate and blocking helpers, an exclude-capable scan for covering everything outside a region, and the viewport helpers responsive chrome needs. Also gate the Vercel bypass secret on a Supabase host, and stop resolving a preview URL from a skipped Vercel build. Docs behavior is unchanged: the emitted axe-results.json is byte-identical.
14 lines
358 B
TypeScript
14 lines
358 B
TypeScript
// Never send a Vercel bypass secret anywhere that can't be a Supabase deployment.
|
|
export function isSupabaseHost(url: string): boolean {
|
|
try {
|
|
const { hostname } = new URL(url)
|
|
return (
|
|
hostname === 'supabase.com' ||
|
|
hostname.endsWith('.supabase.com') ||
|
|
hostname.endsWith('.vercel.app')
|
|
)
|
|
} catch {
|
|
return false
|
|
}
|
|
}
|