Every time I open inspect element on this page, it starts auto refreshing, it does this every time the inspect element tab is open, and it stops whenever the inspect element tab is closed
Use onbeforeunload
// This code will display dialog with Reload or Cancel buttons
window.onbeforeunload = function(event) { return false};
Note: You can inject code at start of page using tools like Tampermonkey