summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaindropsSys <raindrops@equestria.dev>2024-02-01 22:12:30 +0100
committerRaindropsSys <raindrops@equestria.dev>2024-02-01 22:12:30 +0100
commit01a027a0a189389188eac692b309c21d690cd582 (patch)
tree6a37006e23b74e621766c56685b87ae113a22b16
parent8cf30848b351ba17aac183792561373b6b4059df (diff)
downloadchatroom-01a027a0a189389188eac692b309c21d690cd582.tar.gz
chatroom-01a027a0a189389188eac692b309c21d690cd582.tar.bz2
chatroom-01a027a0a189389188eac692b309c21d690cd582.zip
Updated 2 files (automated)
-rw-r--r--client/index.html1
-rwxr-xr-xclient/main.js20
2 files changed, 18 insertions, 3 deletions
diff --git a/client/index.html b/client/index.html
index a0661a9..0e59212 100644
--- a/client/index.html
+++ b/client/index.html
@@ -91,6 +91,7 @@
window.tabs = [];
window.activeTab = -1;
window.protectionEnabled = localStorage.getItem("protection-status") !== "false";
+ refreshInternalProtection();
function toggleProtection() {
window.protectionEnabled = !window.protectionEnabled;
diff --git a/client/main.js b/client/main.js
index bc73211..0586b46 100755
--- a/client/main.js
+++ b/client/main.js
@@ -118,7 +118,7 @@ try {
ipcRenderer.send("start", path);
}
- alert("Automatic updates could work on this system! Please click on OK and tell Raindrops.");
+ //alert("Automatic updates could work on this system! Please click on OK and tell Raindrops.");
</script>
</head>
<body style="margin: 0; user-select: none;">
@@ -155,11 +155,25 @@ ElectronBlocker.fromPrebuiltAdsAndTracking(fetch).then((blocker) => {
});
ipcMain.on('enable-protection', () => {
- global.blocker.enableBlockingInSession(session.defaultSession);
+ let waiter = setInterval(() => {
+ if (global.blocker) {
+ clearInterval(waiter);
+ try { global.blocker.enableBlockingInSession(session.defaultSession); } catch (e) {
+ console.error(e);
+ }
+ }
+ });
});
ipcMain.on('disable-protection', () => {
- global.blocker.disableBlockingInSession(session.defaultSession);
+ let waiter = setInterval(() => {
+ if (global.blocker) {
+ clearInterval(waiter);
+ try { global.blocker.disableBlockingInSession(session.defaultSession); } catch (e) {
+ console.error(e);
+ }
+ }
+ });
});
session.defaultSession.setUserAgent(session.defaultSession.getUserAgent().replace(/(.*)( Electron\/(.*) )/gm, "$1 ") + " Chatroom/1.0.0");