Search code examples
javascriptgoogle-chrome-devtoolsbreakpoints

How to modify inline JS before execution/page load in Chrome/FF?


I'm trying to work on a page whose source I don't have access to - the dev's on that side accidentally updated a piece of functionality to point to the wrong domain...

I just want to continue development, but would need something that will let me do this before the script has a chance to execute.


Solution

  • You may find this answer interesting:

    Intercept and use local files in http requests

    It basically proposes using Fiddler to server all the files from the live site except the ones that you choose (that you can use to load from your disk) and you may continue developing with your version of the site without affecting the actual environment.

    EDIT: You actually don't need to use Fiddler, since most proxies thought for development will have some feature that enables you to answer with your own responses to certain requests. Fiddler does have, however, an in built feature for that, and in that answer some others (like Charle's proxy) are shown as alternatives with similar features.