We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fdfd825 commit fb03441Copy full SHA for fb03441
1 file changed
src/assets/live-realod.js
@@ -0,0 +1,26 @@
1
+/**
2
+ * @file live-reload.js
3
+ * @author Krisna Pranav
4
+ * @brief Live Reload Functionality
5
+ * @version 1.0
6
+ * @date 2024-02-07
7
+ *
8
+ * @copyright Copyright (c) 2025 Krisna Pranav, Moon Developers
9
10
+ */
11
+
12
+(function connect(reload = false) {
13
+ let closing = false;
14
15
+ window.addEventListener("beforeunload", () => {
16
+ closing = true;
17
+ });
18
19
+ var ws = new WebSocket("ws://" + location.host);
20
21
+ ws.onopen = () => {
22
+ if (reload) {
23
+ window.location.reload();
24
+ }
25
+ };
26
+})
0 commit comments