This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2017.
Note: This feature is available in Web Workers.
The read-only entryType property returns a string representing the type of performance metric that this entry represents.
All supported entryTypes are available using the static property PerformanceObserver.supportedEntryTypes.
A string. The return value depends on the subtype of the PerformanceEntry object. Some subtypes have more than one entryType.
elementReports load time of elements.
The entry instance will be a PerformanceElementTiming object.
eventReports event latencies.
The entry instance will be a PerformanceEventTiming object.
first-inputReports the First Input Delay (FID).
The entry instance will be a PerformanceEventTiming object.
largest-contentful-paintReports the largest paint an element triggered on screen.
The entry instance will be a LargestContentfulPaint object.
layout-shiftReports layout stability of web pages based on movements of the elements on the page.
The entry instance will be a LayoutShift object.
long-animation-frameReports instances of long animation frames (LoAFs).
The entry instance will be a PerformanceLongAnimationFrameTiming object.
longtaskReports instances of long tasks.
The entry instance will be a PerformanceLongTaskTiming object.
markReports your own custom performance markers.
The entry instance will be a PerformanceMark object.
measureReports your own custom performance measures.
The entry instance will be a PerformanceMeasure object.
Reports document navigation timing.
The entry instance will be a PerformanceNavigationTiming object.
paintReports key moments of document rendering (first paint, first contentful paint) during page load.
The entry instance will be a PerformancePaintTiming object.
resourceReports timing information for resources in a document.
The entry instance will be a PerformanceResourceTiming object.
taskattributionReports the type of work that contributed significantly to the long task.
The entry instance will be a TaskAttributionTiming object.
visibility-stateReports the timing of page visibility state changes, i.e., when a tab changes from the foreground to the background or vice versa.
The entry instance will be a VisibilityStateEntry object.
The entryType property can be useful when filtering out specific performance entries. For example, you might want to check all script resources, so you would check for an entryType of "resource" and an initiatorType of "script".
const scriptResources = performance
.getEntries()
.filter(
(entry) =>
entry.entryType === "resource" && entry.initiatorType === "script",
);
console.log(scriptResources);
Both, Performance and PerformanceObserver, provide methods that allow you to get performance entries by type directly. You don't necessarily need the entryType property for that, instead you might use Performance.getEntriesByType() or PerformanceObserverEntryList.getEntriesByType().
Also, when observing with a PerformanceObserver, the observe() method takes an array of entryTypes in its options object where you can decide which entry types to observe.
// Log all resource entries at this point
const resources = performance.getEntriesByType("resource");
resources.forEach((entry) => {
console.log(`${entry.name}'s duration: ${entry.duration}`);
});
// PerformanceObserver version
// Log all resource entries when they are available
function perfObserver(list, observer) {
list.getEntriesByType("resource").forEach((entry) => {
console.log(`${entry.name}'s duration: ${entry.duration}`);
});
}
const observer = new PerformanceObserver(perfObserver);
observer.observe({ entryTypes: ["resource", "navigation"] });
| Specification |
|---|
| Performance Timeline> # dom-performanceentry-entrytype> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
entryType |
28 | 12 | 35 | 15 | 11 | 28 | 35 | 14 | 11 | 1.5 | 4.4 | 11 |
PerformanceObserver.supportedEntryTypesPerformance.getEntriesByType()PerformanceObserverEntryList.getEntriesByType()
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/PerformanceEntry/entryType