From 9b3dcf1e00023757f7cc82b749132561e718203d Mon Sep 17 00:00:00 2001 From: Serge Alex Date: Sat, 31 Oct 2026 00:33:03 +0300 Subject: [PATCH] fix-e2-subscriptions-outside-hasToken-gate --- content/content.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/content/content.js b/content/content.js index 8f13245..4fdb573 100644 --- a/content/content.js +++ b/content/content.js @@ -8,6 +8,11 @@ extractCalls = globalThis.extractCalls; } var UI = globalThis.DSHMEM || null; + if (UI) { + UI.onResetLoops(function () { queue.length = 0; pending.clear(); seenHashes.clear(); pumping = false; if (UI) UI.log('loops reset'); }); + UI.onStop(function () { queue.length = 0; if (UI) UI.log('stopped'); }); + UI.onSaveToken(function (v) { chrome.storage.local.set({ 'dshmem-bridge-token': v }, function () { if (UI) UI.log('token saved, reload page'); }); }); + } if (!SEL) return; if (!BRIDGE) return; if (typeof extractCalls !== "function") return; @@ -171,11 +176,6 @@ if (UI) { UI.setPhase('off'); UI.setConnected(false); UI.log('no token'); } return; } - if (UI) { - UI.onResetLoops(function () { queue.length = 0; pending.clear(); seenHashes.clear(); pumping = false; if (UI) UI.log('loops reset'); }); - UI.onStop(function () { queue.length = 0; if (UI) UI.log('stopped'); }); - UI.onSaveToken(function (v) { chrome.storage.local.set({ 'dshmem-bridge-token': v }, function () { if (UI) UI.log('token saved, reload page'); }); }); - } obs.observe(document.documentElement, { childList: true, subtree: true,