PerformanceEventTiming: cancelable property

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

The read-only cancelable property returns the associated event's cancelable property, indicating whether the event can be canceled.

Value

A boolean. true if the associated event is cancelable, false otherwise.

Examples

Observing non-cancelable events

The cancelable property can be used when observing event-timing entries (PerformanceEventTiming). For example, to log and measure non-cancelable events only.

js
const observer = new PerformanceObserver((list) => {
  list.getEntries().forEach((entry) => {
    if (!entry.cancelable) {
      const delay = entry.processingStart - entry.startTime;
      console.log(entry.name, delay);
    }
  });
});

// Register the observer for events
observer.observe({ type: "event", buffered: true });

Specifications

Specification
Event Timing API
# dom-performanceeventtiming-cancelable

Browser compatibility

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
cancelable

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support