- commit
- 5ccbaf7852a4eeb7df538a1367cf8c062dd93381
- parent
- f77008f4c2c75907e489b530b60208443d4c5799
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2023-05-04 19:05
send local changes on close
Diffstat
| M | static/pad.js | 7 | +++++++ |
1 files changed, 7 insertions, 0 deletions
diff --git a/static/pad.js b/static/pad.js
@@ -126,3 +126,10 @@ evtSource.onmessage = function(event) {
126 126 }
127 127 }
128 128 };
-1 129
-1 130 window.addEventListener('beforeunload', event => {
-1 131 if (localChanges.length) {
-1 132 var data = [id, 'changes', localChanges];
-1 133 navigator.sendBeacon(url, JSON.stringify(data));
-1 134 }
-1 135 });