Search

12/09/2013

Badoo Tech Blog :: 5 Advanced Javascript and Web Debugging Techniques You Should Know About

Badoo Tech Blog :: 5 Advanced Javascript and Web Debugging Techniques You Should Know About

Mapping remote scripts locally This method simply allows you to proxy any remote script url’s to a local file on your disk. Where you can modify the file according to your wish and have it act as if the file was modified from the source. This can come in really handy if you are debugging a problem where the source is minified and/or you don’t have the ability to modify the file (think production environments). Note: This does require you to download and install a paid third party app on your machine. There are free alternatives to this method but they require a manual setup of proxies and http servers. How to do it: Download Charles Proxy which is a fantastic proxy tool for debugging network connections Enable Charles for either the whole system or your browser Download the remote file that you wish to debug and save it locally Unminify the file and add any debug code that you wish to In Charles: Tools > Map Local Choose the local file and then modify the remote file to point like the screenshot below. You can even map entire hostnames. Reload the page The remote URL is now read from your locally saved file. Charles Benefits of mapping remote files locally Allows you to debug production code when sourcemaps aren’t available. Allows you to actually make modifications to the code where it wasn’t previously possible.

沒有留言: