@wipcomputer/markdown-viewer
Advanced tools
+10
-0
@@ -6,2 +6,12 @@ # Changelog | ||
| ## 1.2.6 (2026-03-02) | ||
| Republish clean: add .npmignore to prevent ai/ folder from publishing to npm | ||
| ## 1.2.5 (2026-02-25) | ||
| Fix SSE connection pile-up causing blank pages when multiple tabs open in Chrome | ||
| ## 1.2.4 (2026-02-21) | ||
@@ -8,0 +18,0 @@ |
+1
-1
| { | ||
| "name": "@wipcomputer/markdown-viewer", | ||
| "version": "1.2.4", | ||
| "version": "1.2.6", | ||
| "description": "Live markdown viewer for AI pair-editing. Updates render instantly in any browser.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
+24
-2
@@ -191,4 +191,6 @@ #!/usr/bin/env node | ||
| let evtSource = null; | ||
| function connectSSE() { | ||
| const evtSource = new EventSource('/api/events?path=' + encodedPath); | ||
| if (evtSource) { evtSource.close(); evtSource = null; } | ||
| evtSource = new EventSource('/api/events?path=' + encodedPath); | ||
| evtSource.onmessage = async function(event) { | ||
@@ -202,2 +204,3 @@ if (event.data === 'reload') { | ||
| evtSource.close(); | ||
| evtSource = null; | ||
| setTimeout(connectSSE, 2000); | ||
@@ -207,2 +210,13 @@ }; | ||
| connectSSE(); | ||
| // Free SSE connection when tab is hidden (Chrome 6-connection limit). | ||
| // Reconnect when tab becomes visible again. | ||
| document.addEventListener('visibilitychange', function() { | ||
| if (document.hidden) { | ||
| if (evtSource) { evtSource.close(); evtSource = null; } | ||
| } else { | ||
| serverLoad().catch(function(){}); | ||
| connectSSE(); | ||
| } | ||
| }); | ||
| })(); | ||
@@ -328,3 +342,3 @@ </script>`; | ||
| "Content-Type": "text/event-stream", | ||
| "Cache-Control": "no-cache", | ||
| "Cache-Control": "no-cache, no-store", | ||
| Connection: "keep-alive", | ||
@@ -335,2 +349,10 @@ }); | ||
| req.on("close", () => { removeClient(filePath, res); }); | ||
| // Auto-close SSE after 5 minutes to prevent connection pile-up. | ||
| // Client reconnects automatically via EventSource.onerror. | ||
| const maxAge = setTimeout(() => { | ||
| try { res.end(); } catch {} | ||
| removeClient(filePath, res); | ||
| }, 5 * 60 * 1000); | ||
| req.on("close", () => clearTimeout(maxAge)); | ||
| return; | ||
@@ -337,0 +359,0 @@ } |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
5021649
0.02%16363
0.12%