Files
rangerhq-tuner/src/options/options.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

96 lines
3.6 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>RangerHQ Tuner — Options</title>
<link rel="stylesheet" href="options.css">
<link rel="icon" href="../assets/icons/icon-48.png">
</head>
<body>
<header class="opt-header">
<div class="opt-brand">
<img src="../assets/img/ranger.png" alt="" class="opt-helmet">
<h1>RangerHQ Tuner — Options</h1>
</div>
<span class="opt-version" id="opt-version">v—</span>
</header>
<main class="opt-main">
<section class="opt-card">
<h2>Local data</h2>
<p class="opt-note">Everything RangerHQ Tuner stores lives in your browser only. No data is sent anywhere.</p>
<div class="opt-stats">
<div class="opt-stat">
<div class="opt-stat-label">History</div>
<div class="opt-stat-value" id="opt-stat-history">— tracks</div>
</div>
<div class="opt-stat">
<div class="opt-stat-label">Favourites</div>
<div class="opt-stat-value" id="opt-stat-favs">— tracks</div>
</div>
<div class="opt-stat">
<div class="opt-stat-label">Stations cached</div>
<div class="opt-stat-value" id="opt-stat-cache">— stations</div>
</div>
<div class="opt-stat">
<div class="opt-stat-label">Total local data</div>
<div class="opt-stat-value" id="opt-stat-bytes"></div>
</div>
</div>
<div class="opt-row">
<label for="opt-cap">
History cap
<span class="opt-help">How many recent tracks to keep before the oldest are dropped.</span>
</label>
<div class="opt-slider-wrap">
<input type="range" id="opt-cap" min="50" max="500" step="50" value="500">
<span class="opt-slider-value" id="opt-cap-value">500</span>
</div>
</div>
<div class="opt-actions">
<button id="opt-clear-history" class="opt-btn">Clear history</button>
<button id="opt-clear-favs" class="opt-btn">Clear favourites</button>
<button id="opt-clear-all" class="opt-btn opt-btn--danger">Clear EVERYTHING</button>
</div>
</section>
<section class="opt-card">
<h2>Playback</h2>
<div class="opt-row opt-row--inline">
<label>Current volume</label>
<span id="opt-volume-display" class="opt-stat-value"></span>
</div>
<div class="opt-row opt-row--inline">
<label>Last station</label>
<span id="opt-last-station" class="opt-stat-value"></span>
</div>
</section>
<section class="opt-card">
<h2>About</h2>
<p class="opt-about">
RangerHQ Tuner is a lightweight indie internet radio player, sibling to
<a href="https://wordpress.org/plugins/rangerhq-radio/" target="_blank" rel="noopener">RangerHQ Radio</a>
on WordPress.org. No telemetry, no third-party JavaScript, GPL v2 or later.
</p>
<ul class="opt-links">
<li><strong>Repo:</strong> <a href="https://git.davidtkeane.com/ranger/rangerhq-tuner" target="_blank" rel="noopener">git.davidtkeane.com/ranger/rangerhq-tuner</a></li>
<li><strong>Maker:</strong> <a href="https://davidtkeane.com" target="_blank" rel="noopener">davidtkeane.com</a></li>
<li><strong>Stations:</strong> <a href="https://somafm.com" target="_blank" rel="noopener">SomaFM</a> — listener-supported indie radio</li>
<li><strong>Licence:</strong> GPL v2 or later</li>
</ul>
</section>
<p class="opt-toast" id="opt-toast" hidden></p>
</main>
<script type="module" src="options.js"></script>
</body>
</html>