From 14b3f63ef8611b9870ad76dbb657b533e40b0dbe Mon Sep 17 00:00:00 2001 From: josselinonduty Date: Mon, 1 Dec 2025 13:28:30 +0100 Subject: [PATCH] feat: add toggle to hide application offline banner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Original patch: Aurélien Hamy This solves #123 by adding the `--hide-offline-banner` command-line argument to hide the annoying "Application is offline" banner, that sometimes appears when using a VPN or DNS level blocker. --- build/index.html | 6 ++++++ build/main.js | 5 +++++ build/preload.js | 4 ++++ 3 files changed, 15 insertions(+) diff --git a/build/index.html b/build/index.html index 4efcd23..4695231 100644 --- a/build/index.html +++ b/build/index.html @@ -86,6 +86,12 @@ width: auto !important; } } + + /* hide the offline alert when needed */ + .hide-offline-banner + .alert-wrapper:has(> div[data-testid="alert-AppOffline"]) { + display: none !important; + } diff --git a/build/main.js b/build/main.js index e5bc640..8953617 100644 --- a/build/main.js +++ b/build/main.js @@ -3075,6 +3075,11 @@ getRealPath(external_electron_namespaceObject.app, __dirname), "preload.js" ), + additionalArguments: [ + (process.argv.some((arg) => arg === "--hide-offline-banner") || + "yes" === process.env.DZ_HIDE_OFFLINE_BANNER) && + "--hide-offline-banner", + ].filter(Boolean), }, windowOptions = { title: "Deezer Desktop", diff --git a/build/preload.js b/build/preload.js index 9a90de9..80dced7 100644 --- a/build/preload.js +++ b/build/preload.js @@ -527,6 +527,10 @@ external_i18next_default().dir(external_i18next_default().language) ? "rtl" : "ltr"); + if (process.argv.some((arg) => arg === "--hide-offline-banner")) + document + .getElementsByTagName("body")[0] + .classList.add("hide-offline-banner"); }), (module.exports = {}); })(); -- 2.48.1