You can override some basic JavaScript functions that redirect all calls to DOM manipulations to your infrastructure. For example, you can override document.getElementById or setAttribute and appendChild. You can even override them as empty functions. However, this is really not a good practice.
source share