How to set a breakpoint on a minified JS function in Chrome or Safari?

In Chrome when you open Scripts tab you can prettify selected file by clicking on { } button ("Pretty print") at the bottom. After that you can find your line and set a breakpoint. The code will remain prettified with breakpoints in place after a page refresh.

Up vote 1 down vote favorite share g+ share fb share tw.

I'd like to set a breakpoint in a "Cart. Add" function in the Chrome or Safari JavaScript debuggers. Problem is, this function is defined in a large minified JS file, and doesn't exist on a line by itself.

Some documentation says that the WebKit-based debuggers support "break" or "debug" commands in the debug console, but those don't seem to work in newer versions of the debugger. Setting a breakpoint on that line of the JS file doesn't work either, since there are lots of functions on that line. Any suggestions?

Javascript debugging google-chrome safari webkit link|improve this question asked Sep 9 '11 at 18:46Blake Scholl213.

Stackoverflow.com/questions/822119/… – Rikon Sep 9 '11 at 18:50.

The debugger statement is probably what you're looking for. Evaluating the DebuggerStatement production may allow an implementation to cause a breakpoint when run under a debugger. If a debugger is not present or active this statement has no observable effect.

The production DebuggerStatement : debugger ; is evaluated as follows: If an implementation defined debugging facility is available and enabled, then a. Perform an implementation defined debugging action. B.

Let result be an implementation defined Completion value. Else a. Let result be (normal, empty, empty).

Return result. The break statement is for exiting loops and switch statements and has nothing to do with debugging. The real solution though is to not bugger your code in the first place :).

If you have saved the webpage then beautify your js file using jsbeautifier.org which formats your entire script. Then replace your js content with the beautified version. From here you can debug your JS easily.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions