Browse Source

fix-e2-subscriptions-outside-hasToken-gate

master
Serge Shutov 2 weeks ago
parent
commit
9b3dcf1e00
  1. 10
      content/content.js

10
content/content.js

@ -8,6 +8,11 @@ @@ -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 @@ @@ -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,

Loading…
Cancel
Save