mrodriguezr / break-on-access

break on access to a property

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Usage

Omg the cookie is being changed, but where? Give me a breakpoint when JS changes my cookies!

breakOn(document, 'cookie');

Some JS is getting the scrollTop value causing massive Recalculate Styles costs.. Who is the perpetrator PERFetrator?

breakOn(document.body,'scrollTop', 'read')

This works really well as a snippet in the Chrome DevTools:

![](http://i.imgur.com/snA9unr.png)

By default, breakOn will only break when JS attempts to change the value of a property. The third optional argument takes 'read' if you'd also like to break when values are read.

History

Object.defineProperty(twttr, 'profile', {
    get: function () {
      debugger
    }
  , set: function (val) {
      debugger
    }
})

About

break on access to a property