Debug browser code in vscode

One of the selling point of vscode is its built-in debugger. It is quite powerful but not the easiest thing to setup . Debugging Nodejs code is kind of straightforward as usually it is a standalone file or sometime an entry server file. I have a blog on debug typescript mocha and server in vscode. However…

debug nodejs in chrome

The new chrome ships with the about:inspect and a dedicated debugger for nodejs which is super cool! At least we do not have to rely solely on console.log() magic. To do that, run script with an additional flag: node –inspect myServer.js This should fire up the app and then go to a new tab and enter about:inspect. Then…

Fighting with browser popup block

Background Recently in our project, we have a need of refactoring some old struct actions to rest based pages. This way we avoid multiple page navigation for our user so that all the stuff can be done in a single page. One example is file download. Previously in the struts based app, if a page have 12…

inspect angularjs scope controller in chrome(webkit)

Pick an element in the HTML panel of the developer tools and type this in the console angular.element($0).scope() In webkit $0 is a reference to the selected DOM node in the elements tab, so by doing this you get the selected DOM node scope printed out in the console Also you could assign this to…

chrome window.print() window.close()

Chrome used to open a seperate window containing just the element i wanted printed and its relative css. That window then spawned the .print command which opened another window containing print preview. Now Chrome no longer opens a new window for their print preview. Instead it opens a “dialog with overlay” in the current page…