Given some variable set by file1.js
, .e.g:
window.someVar = 'foo';
And some code executed later that mutates the variable in file2.js
, e.g.
window.someVar = 'bar';
Is there some way that, in Chrome DevTools (or some plain JS solution), I can trigger a breakpoint or view a callstack whenever window.someVar
is mutated, so that I can track which source file(s) are mutating it?