3 ms·
It closes the tab when I click "inspect element". How does it detect that?
by obilgic 14y ago
It closes the tab when I click "inspect element". How does it detect that?
- deleted 14y ago[deleted]
- eccp 14y agoit's the window.onblur handler. If you select "inspect element" the browser opens a new window for the developer tools and the previous window loses the focus, triggering the handler. It also happens if you load the page then open a new tab. The previous tab will lose focus and close itself.