( url: string, errorText: string | undefined, resourceType?: string, )
| 35 | const MEDIA_EXTENSIONS = /\.(aac|flac|m4a|mov|mp3|mp4|oga|ogg|wav|webm)$/i; |
| 36 | |
| 37 | export function shouldIgnoreRequestFailure( |
| 38 | url: string, |
| 39 | errorText: string | undefined, |
| 40 | resourceType?: string, |
| 41 | ): boolean { |
| 42 | if (errorText !== "net::ERR_ABORTED") return false; |
| 43 | if (resourceType === "media") return true; |
| 44 | try { |
| 45 | return MEDIA_EXTENSIONS.test(new URL(url).pathname); |
| 46 | } catch { |
| 47 | return false; |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | async function getCompositionDuration(page: import("puppeteer-core").Page): Promise<number> { |
| 52 | return page.evaluate(() => { |
no outgoing calls
no test coverage detected