Files
rangerhq-tuner/src/popup/popup.html
T
ranger ad43df87c0 feat: v0.3.0 — history, 4-button search, options page, newtab override
Web Store submission target. Mirrors rangerhq-radio's track-history pattern
(inc/history.php) so the family stays coherent across surfaces.

Highlights
- New Tab Page override (Tier 2.5) — Chrome's default new tab replaced with
  a RangerHQ-branded landing showing the player, current track, quick chips,
  searchable browse list, and now history + favourites tabs.
- Track history + favourites — capped FIFO 500, dedup against last entry,
  skip "(unknown)" artist (SomaFM dead-air). Stored in chrome.storage.local
  under tuner.history + tuner.favourites.
- 4-button search per entry — Spotify / YouTube / Apple Music / Bandcamp.
  Pure public-search-URL link-outs in a new tab, NO auth, NO API keys, NO
  quota, NO third-party SDK embedded.
- Options page (chrome://extensions → details → options) — live stats,
  history cap slider (50-500), Clear history / Clear favourites / Clear
  EVERYTHING buttons, About panel with Gitea + davidtkeane.com links.
- Popup nav row — Open in tab / History (#hash deep link) / Settings,
  using chrome.tabs.create + chrome.runtime.openOptionsPage. No new perms.
- Cross-surface sync — popup ↔ newtab listen on chrome.storage.onChanged
  for tuner.currentStationId / tuner.isPlaying / history / favourites.
- Storage gateway — offscreen doc can't reliably reach chrome.storage in
  some Chrome versions, so it sends LOG_TRACK_REQUEST to the SW which
  does the write. history.js also defensively guards every storage call.
- Metadata latency fix — polling now starts immediately on PLAY, in
  parallel with audio buffer fill. First track display drops from
  ~10-15s to ~1-2s.

Permissions unchanged
- Still ["offscreen", "storage"] + somafm.com host only.
- chrome.tabs.create works on our own extension URLs without "tabs" perm.
- No webRequest, no <all_urls>, no third-party SDK.

Bumped from 0.1.0 (last tag on Gitea) directly to 0.3.0.
v0.2.0 (newtab + clock) was a working local build but never tagged;
its features ship together with v0.3.0 in this single commit.
2026-06-09 00:23:36 +01:00

61 lines
2.2 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>RangerHQ Tuner</title>
<link rel="stylesheet" href="popup.css">
</head>
<body>
<header class="tuner-header">
<div class="tuner-brand">
<span class="tuner-dot" aria-hidden="true"></span>
<h1>RangerHQ Tuner</h1>
</div>
<span class="tuner-state" id="state-pill" aria-live="polite">idle</span>
</header>
<section class="now-playing" aria-label="Now playing">
<div class="np-station" id="np-station"></div>
<div class="np-track" id="np-track">Pick a station to begin</div>
</section>
<section class="controls" aria-label="Playback controls">
<button id="btn-play" class="btn btn-primary" aria-pressed="false" disabled>▶ Play</button>
<label class="vol-wrap">
<span class="vol-label">Vol</span>
<input type="range" id="volume" min="0" max="100" value="70" aria-label="Volume">
</label>
</section>
<section class="stations" aria-label="Stations">
<label class="search-wrap">
<input type="search" id="search" placeholder="Filter stations…" aria-label="Filter stations">
</label>
<ul id="station-list" class="station-list" role="listbox">
<li class="station-empty">Loading stations…</li>
</ul>
</section>
<nav class="tuner-nav" aria-label="Quick links">
<button id="nav-open-tab" class="tuner-nav-btn" type="button" title="Open full Tuner in a new tab">
<span class="tuner-nav-icon" aria-hidden="true"></span>
<span class="tuner-nav-label">Open in tab</span>
</button>
<button id="nav-history" class="tuner-nav-btn" type="button" title="Open Tuner tab on the History pane">
<span class="tuner-nav-icon" aria-hidden="true"></span>
<span class="tuner-nav-label">History</span>
</button>
<button id="nav-options" class="tuner-nav-btn" type="button" title="Open extension settings">
<span class="tuner-nav-icon" aria-hidden="true"></span>
<span class="tuner-nav-label">Settings</span>
</button>
</nav>
<footer class="tuner-footer">
<span>SomaFM • indie radio • no telemetry</span>
</footer>
<script type="module" src="popup.js"></script>
</body>
</html>