| <!doctype html> |
| <html> |
| |
| <head> |
| <title>Resource Fetched That Are Initiated from Content Script</title> |
| </head> |
| |
| <body> |
| Such resource should not trigger performance timeline resource timing entry. |
| <script> |
| const getResourceTimingEntryCount = () => { |
| return performance.getEntriesByType('resource').filter(e => e.name.includes('24.png')).length; |
| } |
| |
| const getResourceTimingEntryCountAsync = async () => { |
| return await new Promise(resolve => { |
| new PerformanceObserver(entryList => { |
| const length = entryList.getEntries().filter(e => e.name.includes('24.png')).length; |
| if (length) { |
| resolve(length); |
| } |
| }).observe({ type: 'resource', buffered: true }); |
| }); |
| } |
| </script> |
| </body> |
| |
| </html> |