0

I am debugging a complex Front End HTML GUI and at some point some JavaScript adds a CSS property to an element, which shouldn't be there.

I am looking for a way to see which JavaScript code (in terms of file and line number) amended the given (in this case style) property so I can debug it further.

Since the JS code is enormous searching the code is not practical. I need some way to bind to property change events and see who changed them.

5
  • You have search that in resources from each JS file. Commented Jan 2, 2017 at 10:43
  • Website and / or source code? Commented Jan 2, 2017 at 10:43
  • @aavrug The file is several thousand lines of code long and is partially obfuscated. Searching the source is not practical. I need some way to bind to property changes and see who changed them. Commented Jan 2, 2017 at 10:46
  • @ItayGrudev So go through each JS file and use ctrl+f Commented Jan 2, 2017 at 10:47
  • @Caelan That is irrelevant since the question should be universal. Commented Jan 2, 2017 at 11:24

1 Answer 1

1

Right click on html element in Chrome Devtools => Break on => Attributes Modifications. It make code to stop on a point when css property is changed by javascript. If it will stop inside library that changes the css than use the Sorces => Call Stack (at the right) of Devtools toget to the piece of code that calls the library to change css.

Sign up to request clarification or add additional context in comments.

2 Comments

That's neat. Is there a way to save those between page reloads?
I can just add a break point in the beginning of my JS so I can add the attr break point before the JS is ran.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.