Release!
This commit is contained in:
+6
-9
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user