I\'m debugging some 3rd-party minified Javascript that somewhere is triggering a browser page refresh. However, I can\'t figure out what part of the code is causing the refresh.
In Firefox (not Chrome, it's important; UPD 2020: it now works in Chrome as well) Developer Tools, go to the console, enter addEventListener('beforeunload',()=>{debugger})
, and execute your code. After the debugger stops at the debugger
statement, look at the call stack. You'll see what triggered the event. Chrome didn't have it there.
At least, this worked for me.