From 185a5b3e87da49b604348c67f3f845ca72855836 Mon Sep 17 00:00:00 2001 From: krateng Date: Thu, 24 Nov 2022 00:10:33 +0100 Subject: [PATCH] Added scrobbler functionality to selectively enable sites --- .../maloja-scrobbler/background.js | 40 +++++++++++++------ .../maloja-scrobbler/manifest.json | 2 +- 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/auxiliary/chromium_scrobbler/maloja-scrobbler/background.js b/auxiliary/chromium_scrobbler/maloja-scrobbler/background.js index d12ca99..a45f81b 100644 --- a/auxiliary/chromium_scrobbler/maloja-scrobbler/background.js +++ b/auxiliary/chromium_scrobbler/maloja-scrobbler/background.js @@ -11,7 +11,8 @@ const ALWAYS_SCROBBLE_SECONDS = 60*3; // Longer songs are always scrobbled when playing at least 2 minutes pages = { - "Plex Web":{ + "plex":{ + "name":"Plex", "patterns":[ "https://app.plex.tv", "http://app.plex.tv", @@ -20,31 +21,36 @@ pages = { ], "script":"plex.js" }, - "YouTube Music":{ + "ytmusic":{ + "name":"YouTube Music", "patterns":[ "https://music.youtube.com" ], "script":"ytmusic.js" }, - "Spotify Web":{ + "spotify":{ + "name":"Spotify", "patterns":[ "https://open.spotify.com" ], "script":"spotify.js" }, - "Bandcamp":{ + "bandcamp":{ + "name":"Bandcamp", "patterns":[ "bandcamp.com" ], "script":"bandcamp.js" }, - "Soundcloud":{ + "soundcloud":{ + "name":"Soundcloud", "patterns":[ "https://soundcloud.com" ], "script":"soundcloud.js" }, - "Navidrome":{ + "navidrome":{ + "name":"Navidrome", "patterns":[ "https://navidrome.", "http://navidrome." @@ -90,13 +96,21 @@ function onTabUpdated(tabId, changeInfo, tab) { patterns = pages[key]["patterns"]; for (var i=0;i