How to force Chrome's script debugger to reload javascript?

前端 未结 15 1917
天涯浪人
天涯浪人 2020-12-12 09:56

I really like the ability to edit javascript in the chrome debugger however, I find that it can be really problematic getting the debugger to re-fetch the JavaScript from th

相关标签:
15条回答
  • 2020-12-12 10:22

    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

    Open settings Disable the cache


    Chrome circa 2018

    You can also access it on the network tab:

    0 讨论(0)
  • 2020-12-12 10:22

    Deactivating Breakpoints caused the new script to load for me.

    0 讨论(0)
  • 2020-12-12 10:24

    If you are making local changes to a javascript in the Developer Tools, you need to make sure that you turn OFF those changes before reloading the page.

    In the Sources tab, with your script open, right-click in your script and click the "Local Modifications" option from the context menu. That brings up the list of scripts you've saved modifications to. If you see it in that window, Developer Tools will always keep your local copy rather than refreshing it from the server. Click the "revert" button, then refresh again, and you should get the fresh copy.

    0 讨论(0)
提交回复
热议问题