Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

29 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Last.fm Toolbox

π—Ÿπ—”π—¦π—§.𝗙𝗠 π—§π—’π—’π—Ÿπ—•π—’π—«

Greasy Fork GitHub MIT License

A context-aware popup with 60 curated music services across 8 categories, injected into every artist, album, and track link on Last.fm. Includes an AI prompt generator, granular per-service visibility, and a live JSON power-user editor.

Features β€’ Services β€’ Installation β€’ Usage β€’ Configuration β€’ Changelog

##

Layers icon

Installation

Prerequisite: Userscript Manager

Install a userscript manager before proceeding:

Choose one of the following methods:

Method 1: Install via Greasy Fork (Recommended)

Install on Greasy Fork
  1. Visit the Greasy Fork page in your browser.
  2. Click Install this script.

Method 2: Install via GitHub Repository

Clone or Fork on GitHub
  1. Clone or fork the github.com/deathrashed/lastfm-userscript repository.
  2. Drag and drop lastfm-toolbox.user.js into your userscript manager, or copy and paste the raw file contents.

Layers icon Features

Popup & Navigation

  • Context-Aware Popup β€” right-click any music link or click the hover bubble icon
  • SPA Navigation β€” title-mutation observer re-detects context on pushState navigation
  • Chartlist Integration β€” the "..." menu on scrobble rows includes a toolbox entry
  • Keyboard Shortcuts β€” Ctrl+Shift+E to toggle; Esc to close
  • Debounced MutationObserver β€” 250 ms debounce batches DOM mutations; visibilitychange handler re-injects on tab refocus
  • Collapsible Categories β€” all sections collapse/expand; state persisted in localStorage
  • Menu Close Behavior β€” Close on Select (default), Keep Open, or Auto-Close with a configurable delay (1–60 seconds)
  • Track Support β€” full context detection for /music/Artist/_/Track pages and links; AI prompts adapt for tracks

Services & Search

  • 60 Services across 8 categories β€” Databases, Streaming, Lyrics, Covers & Images, Social Media, Utilities, LFM Tools, and AI
  • Inline Sub-Actions β€” Google exposes Images / Video / AI Mode; Album of the Year exposes Tags / Lists / Global Search; TheAudioDB exposes JSON / Markdown downloads
  • AI Prompt Modal β€” context-aware presets in 5 categories (Overview, Analysis, Discovery, Historical, Technical), per-preset overrides per context type, 8 AI providers, Copy / Open / Copy & Open actions
  • Manual Search β€” set context manually via Artist, Artist - Album, or Artist - Album - Track formats; fa-question info icon toggles a popup listing accepted formats
  • Custom Services β€” add your own URLs with {artist}, {album}, {track}, {query}, {type} template variables

UI & Display

  • Light & Dark Mode β€” toggle from Settings or the footer icon; persists in localStorage; sun/moon icon stays in sync
  • Inline Toolbox Toggle β€” choose Bubble (default), Minimal (transparent floating icon), or Highlight-Only (no inline icons; eligible links highlight on hover)
  • Hover Highlight β€” independent toggle that turns eligible text and grid links red on hover; uses strict > a child selectors so play counts and subtitle lines are not affected
  • Customizable Positioning β€” move the toggle button to any of the 4 corners via right-click, Settings, or the userscript manager command
  • Toast Notifications β€” auto-dismissing overlay replaces alert() / prompt() for all settings actions
  • Last.fm Username Setting β€” drives dynamic profile URLs for the LFM Tools category (Bijou, Stats, Live Dashboard, Explr, TapMusic, Time Capsule)
  • Granular Per-Service Visibility β€” every individual service has its own 14Γ—14 px checkmark toggle in the Sections tab (3-column card layout per category); a per-category Open All sub-toggle replaces the old global switch and defaults to off

Advanced & Security

  • Power-User JSON Editor β€” live serialisation of every setting-*, musicengine.*, and lfm-custom-services key inside the Advanced tab; Apply Live Edits clears and rewrites the entire scope from the parsed JSON
  • Export / Import / Reset β€” download a .json backup, paste JSON to restore, or reset to defaults (preserves the custom services list)
  • Link Opening Behavior β€” services default to opening in a new browser tab; switch to a centered popup window in Settings
  • Userscript Manager Commands β€” Toggle, Settings, and Cycle Popup registered in Tampermonkey/Violentmonkey
  • Accessibility β€” prefers-reduced-motion disables animations and transitions
  • Security β€” rel="noopener noreferrer" on every window.open call

Layers icon Services

Primary

Search (Google), Listen (Monochrome), AI Prompt

Databases

Google (+ Images / Video / AI Mode) β€’ TheAudioDB (smart resolution + JSON/MD downloads) β€’ Metal Archives β€’ Rate Your Music β€’ Discogs β€’ MusicBrainz β€’ Wikipedia β€’ Album of the Year (+ Tags / Lists / Global Search) β€’ AllMusic β€’ ListenBrainz β€’ Every Noise at Once

Streaming

Spotify β€’ YouTube β€’ YouTube Music β€’ Apple Music β€’ Bandcamp β€’ SoundCloud β€’ Deezer β€’ Tidal β€’ Qobuz β€’ Amazon Music β€’ Audiomack β€’ Monochrome

Lyrics

Genius β€’ DarkLyrics β€’ Google β€’ Musixmatch

Covers & Images

COV MusicHoarders β€’ Google Images β€’ Yahoo Images β€’ Bing Images β€’ Fanart.tv

Social Media

Instagram β€’ Facebook β€’ Reddit β€’ X (Twitter)

Utilities

Chosic β€’ Spirit of Metal β€’ Metal Storm β€’ Lucida β€’ Sputnikmusic β€’ Audio Archive β€’ WhoSampled β€’ MusicMap

LFM Tools

Bijou β€’ Stats β€’ Live Dashboard β€’ Explr.fm - Regions β€’ TapMusic - Collage β€’ Universal Scrobbler β€’ Time Capsule β€’ Manual Scrobbler

AI

Perplexity β€’ ChatGPT β€’ Claude β€’ Brave AI β€’ Mistral β€’ HuggingChat β€’ You.com β€’ Grok

The five LFM Tools profile services (Bijou, Stats, Live Dashboard, Explr, TapMusic) plus Time Capsule auto-fill the username from the Last.fm Username setting in the General tab.

Layers icon Usage

Open the Toolbox
  • Click the floating Last.fm icon (bottom-left by default), or press Ctrl+Shift+E
  • Right-click any music link, or click its hover bubble icon
  • Hover an image card and click the Last.fm bubble icon
  • Click the "..." menu on any track row in the chartlist
  • Press Esc to close any open menu or modal
Services & Search
  • Open a single service β€” click the row (opens via Popup or Tab per Link Opening Behavior)
  • Force a new tab β€” hover the service row and click the + button
  • Open all services in a category β€” click the Open All link at the bottom of any section (must be enabled per-category in Settings > Sections; hidden by default)
  • Search manually β€” expand Manual Search and type Artist, Artist - Album, or Artist - Album - Track (click the ? icon in the search box for help)
  • Google / AOTY sub-actions β€” click the inline action icons next to the service row (Images, Video, AI Mode, Tags, Lists, Global Search)
  • Download TheAudioDB data β€” click the </> (JSON) or Markdown icon next to TheAudioDB
AI Prompt Modal
  • Open via the AI quick action button in the popup header, or the flask icon next to any AI provider row
  • Pick a Category (Overview / Analysis / Discovery / Historical / Technical), then a Prompt Preset
  • Edit if needed, then choose Copy, Open, or Copy & Open
  • Modified presets are marked with ✎ in the AI modal's dropdown
Customize & Configure
  • Toggle light/dark mode β€” click the sun/moon icon in the footer, or go to Settings > General > Color Theme Mode
  • Add a custom service β€” go to Settings > Custom, fill in Label + URL with {artist}, {album}, {track}, {query}, {type}
  • Hide a single service β€” go to Settings > Sections and uncheck the small box next to the service name
  • Show Open All for one category only β€” go to Settings > Sections and check the "Open All" box at the bottom of that category card
  • Reposition toggle button β€” right-click the toggle button, use Settings > General > Toggle Position, or run the Cycle Popup userscript manager command
Advanced
  • Edit raw settings JSON β€” go to Settings > Advanced, edit the JSON in the power-user editor, click Apply Live Edits
  • Backup / restore settings β€” Settings > Advanced > Export (downloads .json) / Import (paste JSON) / Reset
  • Open Settings β€” click the gear icon in the footer, or use the Settings userscript manager command

Layers icon Configuration

URL Template Variables

For custom services in Settings > Custom:

Variable Replaced with
{artist} URL-encoded artist name
{album} URL-encoded album name (empty for artist context)
{track} URL-encoded track name (empty for non-track contexts)
{query} URL-encoded track + album + artist, or album + artist, or just artist
{type} track, album, or band

Example: https://mysite.com/search?q={query}

Settings Tabs

Tab Options
General Last.fm Username, Inline Toolbox Toggle (Bubble/Minimal/Highlight-Only), Link Opening Behavior (Popup/Tab), Global Button Position, Menu Close Behavior (+ Auto-Close Delay), Hover Highlight, Color Theme Mode
Sections Per-category cards in a 3-column grid; each service has its own 14Γ—14 px checkmark toggle; per-category "Open All" sub-toggle (off by default)
AI Popup Behavior, Auto-Copy Prompt, Default AI Provider, Default Prompt Category, Prompt Preview & Editor (per-preset overrides per context type), Custom Instruction Suffix
Custom Add / edit / remove custom service URLs
Advanced Power-User JSON Editor, Export (downloads .json), Import (paste JSON), Reset (preserves lfm-custom-services), Apply Live Edits
Info Version line, Greasy Fork / GitHub / Issue-tracker links, Recommended Resources

Inline Icon Styles

Style Behaviour
Bubble (default) Dark round bubble icon next to eligible links and image cards
Minimal Transparent floating icon β€” no background or shadow
Highlight Only No inline icons at all; eligible links highlight red on hover instead (the Hover Highlight layer is auto-activated)

AI Prompt Categories

Category Has presets for
Overview Overview, Summary, Background
Analysis Themes, Lyrics, Genre, Compare
Discovery Similar, Hidden Gems, Recommendations
Historical Context, Reception, Legacy
Technical Production, Personnel, Songwriting

Each preset prompt is context-aware β€” it adapts whether you have a track, an album, or just an artist. Custom per-preset overrides can be saved from the AI tab's Prompt Preview & Editor; modified presets are marked with ✎ in the AI modal's dropdown.


Layers icon Limitations

Privacy: Zero tracking, no ads β€” pure client-side JS with localStorage for preferences.

Known Constraints
  • The AI prompt modal generates prompts and opens provider URLs; it does not make API calls or scrape AI websites
  • TheAudioDB uses the free API key 123; if the key changes, update SERVICE_URLS["theaudiodb-link"] in the source
  • If a service changes its search URL format, links may break β€” report it via GitHub issues

Layers icon Changelog

v6 (2026-09-06) β€” Current release
  • AI Prompts Overhauled: Replaced all AI_CATEGORIES presets with structured XML-tagged prompts (<role>/<task>/<constraints>/<output_format>). Categories reorganized: Overview (Summary, Guide, Timeline, Commercial), Analysis (Theory, Lyrics, Sonic, Technical, Vocals), Discovery (Niche, Samples, Playlist, Live), Context (Impact, Lore, Aesthetics, Trivia, Philosophy) β€” replaces the old Overview/Analysis/Discovery/Historical/Technical set
  • Fix: TheAudioDB JSON download no longer saves a near-empty {"artists": null} file when no match is found β€” shows a toast instead
  • Settings AI/Info Cohesion: New shared .settings-card primitive; Prompt Preview & Editor and Custom Instructions now use consistent card styling and typography
  • UI: Replaced heavy settings-group background cards with subtle dividers and border-only hover highlights; Sections tab visual style preserved
  • Fix: AI prompt modal action buttons no longer overflow; the Copy & Open button displays correctly
  • Fix: Settings modal now opens with the General tab content visible by default
  • Info Tab: Removed the standalone "Did you know?" tip and consolidated Recommended Resources into the Info tab
  • New Docs Tab: In-app reference tab in Settings covering shortcuts, right-click hooks, search formats, sections, service rows, TheAudioDB, AI generator, menu behavior, and troubleshooting
  • Category Reorganization: AllMusic moved to Databases, Fanart.tv moved to Covers & Images, Additional category renamed to Utilities
  • New Services: TheAudioDB (with webpage resolution, JSON download, and Markdown download), ListenBrainz (context-aware search per type), Monochrome in Streaming, X (Twitter) in Social Media
  • AOTY Sub-Actions: Album of the Year row now exposes three inline action buttons β€” Tags (fa-tags), Lists (fa-list), and Global Search (fa-earth-europe) β€” mirroring Google's quick-action pattern
  • Google Sub-Actions: Google row exposes inline quick actions for Images (fa-image), Video (fa-video), and AI Mode (fa-flask)
  • LFM Tools Category: New 8th category dedicated to Last.fm-specific profile and scrobble tools β€” Bijou, Stats (lastfmstats.com), Live Dashboard (lastfm.live), Explr.fm - Regions, TapMusic - Collage, Universal Scrobbler, Time Capsule, and Manual Scrobbler. The five profile tools auto-fill the username from the new "Last.fm Username" general setting
  • Every Noise at Once: New database service with type-aware URL routing (track/album/artist modes)
  • MusicMap: New utilities service (musicmap.info)
  • 60 Total Services across 8 categories (Databases, Streaming, Lyrics, Covers & Images, Social Media, Utilities, LFM Tools, AI)
  • Last.fm Username Setting: A new General settings field (setting-lfm-username) that drives the dynamic profile URLs for Bijou, Stats, Live Dashboard, Explr, TapMusic, and Time Capsule
  • Inline Toolbox Toggle: New General dropdown replacing the binary on/off toggle β€” choose Bubble (default), Minimal (transparent floating icon), or Highlight Only (no inline icons; eligible links highlight on hover instead)
  • Hover Highlight: A new General toggle (separate from the inline-icon toggle) that turns eligible text/grid links red on hover to denote right-click capability. Activates automatically when the inline toggle is set to "Highlight Only"
  • Strict Grid Targeting: The hover-highlight layer now uses explicit child selectors (> a) and main-text wrappers so play counts, subtitles, and metadata lines in album/artist grids are no longer highlighted
  • Granular Per-Service Visibility: The Sections tab now renders a 3-column card layout per category, with a small 14Γ—14px checkmark toggle next to every individual service. Each service can be hidden independently (setting-svc-hidden-{id}), and a per-category "Open All" toggle (setting-openall-{cat}) replaces the old global Open All switch
  • Power-User JSON Editor: The Advanced tab has been redesigned into a maximized monospace JSON editor with thin-profile action buttons. The editor live-serializes all setting- / musicengine. / lfm-custom-services keys (with auto-refresh while no field is focused), and the Apply Live Edits button clears and rewrites the entire configuration scope from the parsed JSON
  • Export/Import/Reset Scope Fix: All three Advanced actions now correctly include every key starting with setting- (covering the new setting-svc-hidden-*, setting-openall-*, setting-ai-*, setting-close-delay, and setting-lfm-username keys). Export downloads a .json file; Import accepts pasted JSON and reloads; Reset preserves lfm-custom-services
  • Info Tab: New settings tab with the script version, Greasy Fork / GitHub / Issue-tracker links, and a Recommended Resources section linking out to Bijou and the Last.fm Artwork Upload Helper. The standalone "Did you know?" tip has been removed.
  • AI Auto-Copy Setting: New AI tab toggle (setting-ai-autocopy) β€” when enabled, the Open button automatically copies the prompt to the clipboard before launching the provider
  • AI Default Category Setting: New AI tab dropdown (setting-default-ai-category) that preselects the prompt category in the AI modal (Overview, Analysis, Discovery, Historical, or Technical)
  • AI Prompt Preset Overrides: The AI tab now includes a Prompt Preview & Editor that lets you customize individual preset prompts per context type (track/album/artist). Modified presets are marked with a ✎ and persist via setting-ai-preset-override-{cat}-{idx}-{ctxType}
  • AI Modal Polish: Redesigned with a centered brand-colored eyebrow header, absolute-positioned close button, gear icon jumping to the AI settings tab, and thin .settings-tab-style buttons (Copy, Open, Copy & Open)
  • Checkbox Toggle Switches: All toggle switches are now 20Γ—20px bordered checkboxes (4px radius) showing a fa-radiation icon when active (parent/primary toggles) or a fa-check icon (sub-item toggles, 14Γ—14px / 3px radius). Icons are hidden when inactive to keep the unchecked box empty. Icon color follows --text-primary so it stays white in dark mode and black in light mode
  • Default Open Mode: Services now default to opening in a new browser tab (musicengine.defaultOpenMode = "tab") instead of a popup window
  • Debounced MutationObserver: Replaced the requestAnimationFrame observer pattern with a 250ms debounce timer that batches DOM mutations and prevents main-thread jank on heavily-mutating Last.fm pages
  • Theme Variables: Added --brand-rgb (218, 35, 35) for use in rgba() chip and active-state tints; toggle color now driven by --brand rather than the legacy --toggle-off/--toggle-on pair
  • Accessibility: prefers-reduced-motion continues to disable all animations and transitions
  • Category Reorganization: AllMusic moved to Databases, Fanart.tv moved to Covers & Images, Additional category renamed to Utilities
  • New Services: TheAudioDB (with webpage resolution, JSON download, and Markdown download), ListenBrainz (context-aware search per type), Monochrome in Streaming, X (Twitter) in Social Media
  • TheAudioDB Smart Resolution: Clicking the service link fetches the API JSON, extracts the artist ID, and redirects to the actual visual webpage. Also includes dedicated buttons to download raw JSON or formatted Markdown files.
  • Icon Updates: Tidal (fa-water), Grok (fa-x-twitter), Search quick action (fa-search), plus icons for all new services
  • Manual Search Info Popup: Replaced text with a fa-question icon inside the search box that toggles a small popup above showing accepted formats
  • AI Provider Popup Toggle: Each AI service now has a robot icon button that opens the AI prompt modal with that provider pre-selected
  • Settings Modal Redesign: Vertical collapsible sidebar tabs (icon-only or expanded), centered "Settings" title (22px), footer showing current tab name, less button padding, improved hover/active states, Open Toolbox button removed
  • Menu Close Behavior: New setting with three options β€” Close on Select (default), Keep Open, Auto-close (3s)
  • Open All Off by Default: Open All links are now hidden by default; must be enabled in Settings > Sections
  • Light/Dark Icon Sync: Toggling light mode via settings modal now also updates the footer sun/moon icon
  • Toast Notifications: Replaced all alert()/prompt() calls with an auto-dismissing toast overlay for settings actions
  • CSS Cleanup: Removed duplicate #external-music-menu a rule; scrollbar colors now use CSS variables (--scrollbar-bg, --scrollbar-thumb, --scrollbar-thumb-hover)
  • Security Fixes: Added rel="noopener noreferrer" to all window.open calls; fixed Amazon Music domain (.com.au β†’ .com)
  • Performance: Removed redundant setInterval (3s) and setTimeout (2s) β€” MutationObserver + visibilitychange handler suffice
v5 (2026-06-27)
  • Toggle Button Positioning: Reposition the toggle button to Top Left, Top Right, Bottom Left, or Bottom Right (via right-click, Settings, or the userscript command menu).
  • Fixed Header Compatibility: Top button positions are aligned to top: 75px to clear the fixed Last.fm header bar.
  • Z-Index Improvements: Increased z-index to 99999999 to ensure the button/menu sits above all page UI and cookie toggles.
  • Menu Bottom Alignment: The menu remains bottom-aligned (left-to-right movement only) for a consistent layout.
  • Open Toolbox in Settings: Added an "Open Toolbox" button directly in the Settings modal header.
  • Settings Modal Polish: Set modal box to a fixed 650px width by 650px height. Inner panels are scrollable while tabs and the title header remain fixed.
  • Unified Visual Style: Added a custom CONFIG badge (which adapts in light/dark modes) and styled tabs as custom outline pills.
  • Advanced Preference Actions: Implemented settings backup operations (Export to clipboard, Import from clipboard, and Reset preferences to defaults).
  • Userscript Manager Command Integration: Registered Toggle, Settings, and Cycle Popup commands in Violentmonkey/Tampermonkey.
v4 (2026-06-11)
  • Light & dark mode with CSS custom properties
  • Settings modal with tabs (General, Sections, AI, Custom, Advanced)
  • AI prompt modal with dropdown presets, provider selection, Copy/Copy & Open/Open
  • Service popup system: main row opens centered popup, hover + forces new tab
  • Default Open Mode setting: Popup Window or New Tab for all services
  • AI providers: ChatGPT, Claude, Perplexity, Brave AI, Mistral, HuggingChat, You.com, Grok
  • Track context support: detect /music/Artist/_/Track pages and links
  • Context badges with distinct colors for artist/album/track
  • Quick actions: icon-only with text revealed on hover
  • Footer with gear settings and light/dark toggle icons
  • Manual Search with Artist, Artist - Album, and Artist - Album - Track support
  • Custom services with {artist}, {album}, {track}, {query}, {type} templates
  • Collapsible categories with state persistence in localStorage
  • Unified scrollbar system across all panels
  • Keyboard shortcut: Ctrl+Shift+E
  • 35+ services across 7 categories
  • Hover and grid toolbox icons on artist/album/track links
  • Right-click context menu support
  • Chartlist integration
  • Open All per category
  • SPA navigation detection
  • MutationObserver for dynamic content
v3 β€” Initial public release
  • 30+ services, hover icons, right-click support, collapsible sections, manual search

Layers icon Source

github.com/deathrashed/lastfm-userscript

Bugs, feature requests, or suggestions β€” open an issue on GitHub.

Layers icon Recommended

Last.fm Artwork Upload Helper by chr1sx

  • a userscript that streamlines uploading album artwork
  • Using COV integration to find high-quality covers, then opens the Last.fm upload page with the image pre-filled and ready to submit
  • This is a must-have tool.

Bijou

  • a collection of Last.fm tools and utilities

About

A context-aware popup with 60 curated music services across 8 categories, injected into every artist, album, and track link on Last.fm. Includes an AI prompt generator, granular per-service visibility.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages