The disconnect() method of the PerformanceObserver interface is used to stop the performance observer from receiving any performance entry events.




var observer = new PerformanceObserver(function(list, obj) {
  var entries = list.getEntries();
  for (var i=0; i < entries.length; i++) {
    // Process "mark" and "frame" events
observer.observe({entryTypes: ["mark", "frame"]});

function perf_observer(list, observer) {
  // Process the "measure" event 
  // ...
  // Disable additional performance events
var observer2 = new PerformanceObserver(perf_observer);
observer2.observe({entryTypes: ["measure"]});


Specification Status Comment
Performance Timeline Level 2
The definition of 'disconnect()' in that specification.
Candidate Recommendation Initial definition of disconnect() method.

Browser compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic supportChrome Full support 52Edge ? Firefox Full support 57IE No support NoOpera Full support 39Safari Full support 11WebView Android No support NoChrome Android Full support 52Edge Mobile ? Firefox Android Full support 57Opera Android Full support 39Safari iOS Full support 11Samsung Internet Android ?


Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown

Document Tags and Contributors

Contributors to this page: jpmedley, fscholz, chrisdavidmills, teoli, rolfedh, AFBarstow
Last updated by: jpmedley,