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