deezer-linux/patches/08-hide-offline-banner.patch
2025-12-01 17:34:12 +01:00

70 lines
2.2 KiB
Diff

From 14b3f63ef8611b9870ad76dbb657b533e40b0dbe Mon Sep 17 00:00:00 2001
From: josselinonduty <contact@josselinonduty.fr>
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 <aunetx@yandex.com>
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;
+ }
</style>
</head>
<body class="electron">
diff --git a/build/main.js b/build/main.js
index e5bc640..8953617 100644
--- a/build/main.js
+++ b/build/main.js
@@ -3074,6 +3074,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