mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-05-02 02:22:06 -04:00
osd(media): workaround for firefox reporting youtube thumbnails as
players fixes #2298
This commit is contained in:
@@ -10,4 +10,14 @@ Singleton {
|
||||
|
||||
readonly property list<MprisPlayer> availablePlayers: Mpris.players.values
|
||||
property MprisPlayer activePlayer: availablePlayers.find(p => p.isPlaying) ?? availablePlayers.find(p => p.canControl && p.canPlay) ?? null
|
||||
|
||||
function isFirefoxYoutubeHoverPreview(player: MprisPlayer): bool {
|
||||
if (!player)
|
||||
return false;
|
||||
const id = (player.identity || "").toLowerCase();
|
||||
if (!id.includes("firefox"))
|
||||
return false;
|
||||
const url = (player.metadata?.["xesam:url"] || "").toString();
|
||||
return /^https?:\/\/(www\.)?youtube\.com\/?($|\?|#)/i.test(url);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user