This post is the second post in the series 'Fiddler – the tool that gives you superpowers!'
This time it's the superpower of Invisibility! Wow I hear you say!
Fiddler is a web debugger that sits between you and the server and so is in the unique position of being able to listen for requests for a specific file and rather than returning the version on the server return a version from your local disk instead. This is called and 'AutoResponder' and sounds like a super-hero it's self – or perhaps a transformer (robots in disguise).
Here are the steps to add an auto responder:
1) Install Fiddler (if you've not already!) and ensure decrypt HTTPS traffic is checked in Options->HTTPS.
2) Switch to the 'Auto Responders' tab and check the two checkboxes 'Enable automatic responses' and 'Unmatched requests pass-through'
3) To ensure that the browser requests a version of the web resource rather than a cached version from the server you'll need to clear the browser cache using the convenient 'Clear Cache' button on the tool bar.
4) You can ensure that no versions get subsequently cached by selecting Rules-> Performance-> Disable Caching.
5) You can now use 'Add Rule' to add an auto responder rule. Enter a regular expression to match the web resource name
regex:(?insx).+/<Web Resource Name>([?a-z0-9-=&]+\.)*
then enter the file location of the corresponding webresource in your Visual Studio Developer Toolkit project.
You are now good to go so that when you refresh your browser the version of your web resource will be loaded into the browser directly from your Visual Studio project. No need to publish a file to the server and affect other users.
There is one caveat to this – If the script that you are debugging updates data then this approach is probably not a good idea until you are have fully tested the script in a non-production environment. Only once you have QAed and ready to deploy can be it be used against the production environment to check that the specific user's issue is fixed before you commit to deploying it to all users.
Read the next post on how to be faster than a speeding bullet!