From 301f98cff20a98ffbfbf1ddb44458aca5ef19ea7 Mon Sep 17 00:00:00 2001 From: univrsal Date: Fri, 22 Nov 2024 19:01:07 +0100 Subject: [PATCH] Deezer: Fix play/pause button --- deps/tuna_browser.user.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/deps/tuna_browser.user.js b/deps/tuna_browser.user.js index 1ab65d3..ca01b9d 100644 --- a/deps/tuna_browser.user.js +++ b/deps/tuna_browser.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Tuna browser script // @namespace univrsal -// @version 1.0.23 +// @version 1.0.24 // @description Get song information from web players, based on NowSniper by Kıraç Armağan Önal // @author univrsal // @match *://open.spotify.com/* @@ -219,9 +219,9 @@ post({ cover, title, artists, status, progress, duration, album_url, album }); } } else if (hostname === 'www.deezer.com') { - let status = query('.chakra-button.css-h1gi0s', e => { - return e.getAttribute('aria-label').toLowerCase() === "play" ? "paused" : "playing"; - }, "stopped"); + const pauseBtn = document.querySelector('[data-testid="play_button_pause"]'); + const playBtn = document.querySelector('[data-testid="play_button_play"]'); + let status = pauseBtn !== null ? "playing" : (playBtn !== null ? "paused" : "stopped"); if ("mediaSession" in navigator && navigator.mediaSession.metadata !== null) { let data = navigator.mediaSession;