Skip to content

NV/setInterval-sniffer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

setInterval sniffer

Chrome DevTools Timers panel

This no longer works

If you relly want to see this extension, consider sponsoring my projects.

Install

From Chrome App Store or from the repository:

  • chrome://extensions/
  • Turn on "Developer mode" checkbox
  • Click "Load unpacked extension..." button
  • Select setInterval-sniffer/chrome folder

How does it work

The sniffer monkey patch (extend without altering the original source code) setInterval method:

var originalSetInterval = window.setInterval;
window.setInterval = function(fn, time) {
	var id = originalSetInterval(fn, time);
	post({
		functionName: 'setInterval',
		fn: fn.toString(),
		id: id,
		time: time
	});
	return id;
};

Roadmap

  • Don't stop sniffing on page reload
  • Button to kill an interval in Timers panel
  • Add stacktrace data using the technic from captureCalls.js
  • Display setTimeout too, visually separate them from setInterval
  • Make it prettier