From af09db3d3ecc2babb9aa8b444ce44940dfc4598f Mon Sep 17 00:00:00 2001 From: Serge Alex Date: Mon, 2 Nov 2026 05:05:34 +0300 Subject: [PATCH] fix-skip-remark-on-root-to-chat-transition --- content/content.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/content.js b/content/content.js index 4daffb4..0283124 100644 --- a/content/content.js +++ b/content/content.js @@ -30,7 +30,7 @@ var queue = []; var pumping = false; var timer = null; - var pending = new Set(); var lastPath = location.pathname; function __onPathChange() { var p = location.pathname; if (p === lastPath) return; lastPath = p; queue.length = 0; pending.clear(); seenHashes.clear(); seenCallsHashes.clear(); pumping = false; setTimeout(function () { try { markExistingAsProcessed(); } catch (e) { } }, 200); setTimeout(function () { try { markExistingAsProcessed(); } catch (e) { } }, 1200); if (UI) { UI.setPhase('idle'); if (UI.log) UI.log('chat changed ' + p); } try { window.dispatchEvent(new CustomEvent('dshmem:chat-change', { detail: p })); } catch (e) {} } window.addEventListener('popstate', __onPathChange); try { var __ps = history.pushState; var __rs = history.replaceState; history.pushState = function () { var r = __ps.apply(this, arguments); setTimeout(__onPathChange, 0); return r; }; history.replaceState = function () { var r = __rs.apply(this, arguments); setTimeout(__onPathChange, 0); return r; }; } catch (e) {} setInterval(__onPathChange, 1000); + var pending = new Set(); var lastPath = location.pathname; function __onPathChange() { var p = location.pathname; if (p === lastPath) return; var __prev = lastPath; lastPath = p; var __fromRoot = (__prev === '/' || __prev === ''); queue.length = 0; pending.clear(); seenHashes.clear(); seenCallsHashes.clear(); pumping = false; if (!__fromRoot) setTimeout(function () { try { markExistingAsProcessed(); } catch (e) { } }, 200); if (!__fromRoot) setTimeout(function () { try { markExistingAsProcessed(); } catch (e) { } }, 1200); if (UI) { UI.setPhase('idle'); if (UI.log) UI.log('chat changed ' + p); } try { window.dispatchEvent(new CustomEvent('dshmem:chat-change', { detail: p })); } catch (e) {} } window.addEventListener('popstate', __onPathChange); try { var __ps = history.pushState; var __rs = history.replaceState; history.pushState = function () { var r = __ps.apply(this, arguments); setTimeout(__onPathChange, 0); return r; }; history.replaceState = function () { var r = __rs.apply(this, arguments); setTimeout(__onPathChange, 0); return r; }; } catch (e) {} setInterval(__onPathChange, 1000); function hashText(s) { var h = 5381;