From 5a70499ad0455fe8f5e994053edf936e7015fbc8 Mon Sep 17 00:00:00 2001 From: Agampreet Singh <68941022+agam778@users.noreply.github.com> Date: Sat, 10 Jun 2023 01:24:26 +0530 Subject: [PATCH] Update Discord RPC whenever a new window is created --- app/main.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/main.js b/app/main.js index 8a30c0d..7d60420 100644 --- a/app/main.js +++ b/app/main.js @@ -245,6 +245,11 @@ app.on("web-contents-created", (event, contents) => { }); app.on("browser-window-created", (event, window) => { + window.webContents.on("did-finish-load", () => { + if (store.get("discordrpcstatus") === "true") { + setActivity(`On "${window.webContents.getTitle()}"`); + } + }); if (store.get("blockads") === "true") { ElectronBlocker.fromPrebuiltAdsOnly(fetch).then((blocker) => { blocker.enableBlockingInSession(window.webContents.session);