Search code examples
javascripthtmlweb-developer-toolbar

Blocking the loading of an external library in javascript - a bizarrely constrained riddle


Here's the problem - I have a webpage with some javascript on it. The javascript loads elements sequentially. One of those elements is a script which conflicts with and breaks the remaining javascript on the page.

How can I selectively block that script from loading using only the Chrome or Firefox development console?

Forget for the moment how I got into this mess - the important points are: I no longer have access to the source code of the page, I cannot stop the external JS from loading, and the script tag only loads right before it is executed (as far as I can tell).

Kludgy solutions encouraged - I only need to do this twice, I think, to get everything back to normal!


Solution

  • I recommand you to use AdBlock for Chrome. You will be able to prevent files to load.

    https://chrome.google.com/webstore/detail/adblock/gighmmpiobklfepjocnamgkkbiglidom

    In the Chrome Developer Tools, click on the "AdBlock" tab, refresh the document and block whatever you want.