This commit is contained in:
2026-06-11 10:43:30 -04:00
parent 336e6a264c
commit 4f92942ccb
9 changed files with 175 additions and 24 deletions
+6 -9
View File
@@ -1,6 +1,6 @@
(function() {
(function () {
var originalOpen = window.open;
window.open = function(url) {
window.open = function (url) {
if (url) { window.location.href = url; return null; }
return originalOpen.apply(this, arguments);
};
@@ -9,7 +9,7 @@
Notification.requestPermission();
}
var seenAlerts = {};
setInterval(function() {
setInterval(function () {
if (!document.body) return;
var text = document.body.innerText;
@@ -27,11 +27,8 @@
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
});
if (window.__TAURI_INTERNALS__) {
window.__TAURI_INTERNALS__.invoke('alert_detected', { name: key });
}
try {
var ctx = new AudioContext();
@@ -43,7 +40,7 @@
gain.gain.value = 0.3;
osc.start();
osc.stop(ctx.currentTime + 0.5);
} catch(e) {}
} catch (e) { }
}
}
seenAlerts = currentAlerts;