Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nv/setinterval-sniffer

Keep tabs on your uncleared intervals. Hunt down lags and memory leaks.
https://github.com/nv/setinterval-sniffer

chrome-devtools chrome-devtools-extension chrome-extension debugging-tool javascript

Last synced: 10 days ago
JSON representation

Keep tabs on your uncleared intervals. Hunt down lags and memory leaks.

Awesome Lists containing this project

README

        

# setInterval sniffer

![Chrome DevTools Timers panel](http://nv.github.io/setInterval-sniffer/setInterval-sniffer.png)

## This no longer works

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

## Install

From [Chrome App Store](https://chrome.google.com/webstore/detail/setinterval-sniffer/odkgihncjgklajjabihpoipfnpcjhdno) 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:

```javascript
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](https://github.com/NV/captureCalls.js)
* Display setTimeout too, visually separate them from setInterval
* Make it prettier