Search code examples
javascriptwebminify

Editing the source of a minimised javascript


I'm new to Javascript and web development, but I've been writing iOS software for the past 7 years. I'm not a complete noob. Here's the issue I'm having. I'm having a minimised Javascript file which is inserted in the website on the internet. How can edit the original source, while testing this on the website online where the bug in the Javascript is appearing. Google Chrome appears to have a function like that, but I can't seem to make it work. Any tips, resources or explanation so I can get this thing figured out?

Thanks.


Solution

  • Yes, Chrome has "overrides" function which allows this.

    Step 1: enable overrides

    F12 > Sources > Overrides (in the left tab) > Enable Local overrides

    You'll need to provide a path for it to save the scripts

    Step 2: go

    F12 > Sources > Network > Locate the relevant JS file > right-click > save for override

    Go back to Overrides, navigate to the file and edit it. CTRL+S to save, then F5 to reload. Since you have the original javascript, you might as well replace the minified source with the original in the override.