diff --git a/src/Tracy/Bar/assets/bar.js b/src/Tracy/Bar/assets/bar.js index c37a48809..3ce40b387 100644 --- a/src/Tracy/Bar/assets/bar.js +++ b/src/Tracy/Bar/assets/bar.js @@ -166,7 +166,7 @@ class Panel doc.title = this.elem.querySelector('h1').textContent; } - win.addEventListener('beforeunload', () => { + win.addEventListener('pagehide', () => { this.toPeek(); win.close(); // forces closing, can be invoked by F5 }); @@ -469,7 +469,7 @@ class Debug size = newSize; }); - window.addEventListener('unload', () => { + window.addEventListener('pagehide', () => { for (let id in Debug.panels) { Debug.panels[id].savePosition(); } diff --git a/src/Tracy/assets/toggle.js b/src/Tracy/assets/toggle.js index 718aa7567..1406f33ef 100644 --- a/src/Tracy/assets/toggle.js +++ b/src/Tracy/assets/toggle.js @@ -89,7 +89,7 @@ class Toggle }); } - window.addEventListener('unload', () => { + window.addEventListener('pagehide', () => { toggles = saved.map((el) => { let item = {path: [], text: el.textContent, expand: !el.classList.contains('tracy-collapsed')}; do {