How to force Chrome's script debugger to reload javascript?
While you are developing your script, try disabling the Chrome cache.
When you reload the page, the JavaScript should now get refreshed.
Chrome circa 2011
Chrome circa 2018
You can also access it on the network tab:
The context menu shown above is accessible by right clicking / presssing & holding the "reload" button, while Chrome Dev Tools is opened.
Empty cache and hard reload works best for me.
Another Advantage: This option keeps all other opened tabs and website data untouched. It only reloads and clears the current page.
You can always clear a specific file by doing the following:
- Open Dev Tools
- Click on the Sources tab
- Find your script / image / file
- Check the right panel to see if your file is up to date
If not:
- Right click the resource in the left panel and choose 'Open Link in New Tab'
- Force a reload of the resource with the methods above. (See @Bishoy Hanna's example)
This is very handy if you have resources that are in frames and CTRL+F5
is not force refreshing them.