I'm trying to diagnose an issue with a web app that uses multiple Javascript files. One of the scripts modifies DOM by injecting a new element into it. My idea is that I would disable js files one by one until I find the one that causes the DOM modification. Is there a way in a browser to disable only certain js files? I would prefer a solution in Google Chrome (if its not possible then in Firefox or IE11)
I'm trying to diagnose an issue with a web app that uses multiple Javascript files. One of the scripts modifies DOM by injecting a new element into it. My idea is that I would disable js files one by one until I find the one that causes the DOM modification. Is there a way in a browser to disable only certain js files? I would prefer a solution in Google Chrome (if its not possible then in Firefox or IE11)
Share Improve this question asked Dec 23, 2013 at 16:27 DmitryDmitry 4,37311 gold badges49 silver badges58 bronze badges 5- 2 See stackoverflow./questions/9698059/… – Anton Kovalenko Commented Dec 23, 2013 at 16:32
- 1 Are you not able to simply ment out the files, or are you unable to edit the code? – Kelly J Andrews Commented Dec 23, 2013 at 16:40
- I'm able to do both its just I was looking for a way to do error catching and code editing inside developer tools. That's the approach that experts seem to remend – Dmitry Commented Dec 23, 2013 at 17:07
- 1 Can't it be more simple to use breakpoints on DOM mutation? – Stan Commented Dec 23, 2013 at 19:17
- Using fiddler 'AutoResponder', you can stop loading the a file itself. You can select the what kind of response need to be served to the browser in place of original content. Try 404 response for JS files one after the other. Good Luck !!! – Venkatesh Achanta Commented Feb 24, 2016 at 10:21
3 Answers
Reset to default 3Try DOM Change Breakpoints. Whenever some JS modifies your DOM, you pause on the exact line of code that caused the change.
And yes, it is possible to disable JS files. See Block Requests. DevTools blocks the request for the JS file, therefore it never runs. Although in this particular situation, DOM Change Breakpoints will probably help you diagnose the problem faster.
Well, you can try to use SYBU JavaScript Blocker extension if you are in chrome, i don't know if that extension exists for other navigators.
Probably you should use an external tool like fiddler, or use Browser Plugins. Firefox and Chrome both has plugins that can do this.