google-chrome-devtoolsdeveloper-toolsfirefox-developer-tools

Break if element of an object in watch has specific value


I've added an element to my watchlist. Is it possible to set a breakpoint if the value of an element matches a certain value?

developer tools

For example, it should stop as soon as the value of the element className is mceEditor. At the moment I have to manually go to this position step by step, by step...

Is that possible? Are there any developer tools which are capable of doing this?


Solution

  • I figured out that there are conditional breakpoints. I added one at the correct spot and now it is just like I desired.

    elm.className == 'mceEditor'

    Chrome: Open the developer tools and open the tab "sources". then right click on the line number and select "Add conditional breakpoint" and set your condition.