Uncomment stopping and adding source to URL

This commit is contained in:
2025-11-03 08:50:20 -05:00
parent bcc59d2685
commit d0575dae6c

View File

@ -1,6 +1,6 @@
// ======== Life Scrobbler Extension ======== // ======== Life Scrobbler Extension ========
// Fully self-contained version with base64 icons const SCROBBLE_ENDPOINT = "https://life.lab.unbl.ink/?source=Firefox&scrobble_url=";
// Stop scrobble code is commented out for now const STOP_ENDPOINT = "https://life.lab.unbl.ink/?action=stop&scrobble_url=";
// ====== Default Settings ====== // ====== Default Settings ======
const DEFAULT_SETTINGS = { const DEFAULT_SETTINGS = {
@ -149,15 +149,17 @@ browser.browserAction.onClicked.addListener(async (tab) => {
setPaused(tab.id, !tabPaused); setPaused(tab.id, !tabPaused);
}); });
// ====== Clean up on Tab Close ======
browser.tabs.onRemoved.addListener((tabId) => { browser.tabs.onRemoved.addListener((tabId) => {
if (activeTabs.has(tabId)) clearTimeout(activeTabs.get(tabId)); if (activeTabs.has(tabId)) clearTimeout(activeTabs.get(tabId));
pausedTabs.delete(tabId); pausedTabs.delete(tabId);
}); });
// ====== Web Navigation stop code is commented ====== <<<<<<< HEAD
browser.webNavigation.onBeforeNavigate.addListener((details) => { browser.webNavigation.onBeforeNavigate.addListener((details) => {
const { scrobbleBaseUrl } = DEFAULT_SETTINGS; stopScrobble(details.tabId, details.url);
// scrobbleStop(details.url, scrobbleBaseUrl); });
// TODO need to fix this in Scrobbler to check if a running scrobble exists and stop if it does
browser.browserAction.onClicked.addListener(async () => {
const { paused } = await getSettings();
setPaused(!paused);
}); });