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
Asked
Active
Viewed 478 times
-1
-
1Welcome to SO. You might find reading the site [help section](https://stackoverflow.com/help) useful when it comes to [asking a good question](https://stackoverflow.com/help/how-to-ask), and this [question checklist](https://meta.stackoverflow.com/questions/260648/stack-overflow-question-checklist). Code that you've worked on to solve the problem should include a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example), and be included in your question. – Louys Patrice Bessette Mar 20 '22 at 15:48
1 Answers
0
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

Hemant Patel
- 51
- 1
- 3