Skip to content

Commit 36053c1

Browse files
committed
js: unload replaced with pagehide [Closes #576]
1 parent 42d88b2 commit 36053c1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Tracy/Bar/assets/bar.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ class Panel
166166
doc.title = this.elem.querySelector('h1').textContent;
167167
}
168168

169-
win.addEventListener('beforeunload', () => {
169+
win.addEventListener('pagehide', () => {
170170
this.toPeek();
171171
win.close(); // forces closing, can be invoked by F5
172172
});
@@ -469,7 +469,7 @@ class Debug
469469
size = newSize;
470470
});
471471

472-
window.addEventListener('unload', () => {
472+
window.addEventListener('pagehide', () => {
473473
for (let id in Debug.panels) {
474474
Debug.panels[id].savePosition();
475475
}

src/Tracy/assets/toggle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class Toggle
8989
});
9090
}
9191

92-
window.addEventListener('unload', () => {
92+
window.addEventListener('pagehide', () => {
9393
toggles = saved.map((el) => {
9494
let item = {path: [], text: el.textContent, expand: !el.classList.contains('tracy-collapsed')};
9595
do {

0 commit comments

Comments
 (0)