From 336e6a264cfce17ed87eb1ec214f18bb96c20ded Mon Sep 17 00:00:00 2001 From: mysticmomba Date: Wed, 10 Jun 2026 16:46:11 -0400 Subject: [PATCH] Wired up notification framework. Next is bringing to forefront automatically. --- src/inject.js | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/src/inject.js b/src/inject.js index 4da42d8..9de8fac 100644 --- a/src/inject.js +++ b/src/inject.js @@ -4,4 +4,49 @@ if (url) { window.location.href = url; return null; } return originalOpen.apply(this, arguments); }; -})(); \ No newline at end of file + if (window.location.href.includes('helpalert.html')) { + if (Notification.permission === 'default') { + Notification.requestPermission(); + } + var seenAlerts = {}; + setInterval(function() { + if (!document.body) return; + + var text = document.body.innerText; + var currentAlerts = {}; + + var lines = text.split('\n'); + for (var i = 0; i < lines.length; i++) { + if (lines[i].trim().startsWith('Geo:') && i > 0) { + var name = lines[i - 1].trim(); + if (name && name !== 'Claim' && name !== 'VIDEO') { + currentAlerts[name] = true; + } + } + } + for (var key in currentAlerts) { + if (!seenAlerts[key]) { + console.log('[DuressGuard] NEW ALERT:', key); + if (Notification.permission === 'granted') { + new Notification('DURESS ALERT', { + body: key, + requireInteraction: true + }); + } + try { + var ctx = new AudioContext(); + var osc = ctx.createOscillator(); + var gain = ctx.createGain(); + osc.connect(gain); + gain.connect(ctx.destination); + osc.frequency.value = 800; + gain.gain.value = 0.3; + osc.start(); + osc.stop(ctx.currentTime + 0.5); + } catch(e) {} + } + } + seenAlerts = currentAlerts; + }, 2000); + } +})();; \ No newline at end of file