Vanilla Breeze v0.7.4

Vanilla Breeze v0.7.4 released

0.7.4 gives the Ambient pack weather. A page names one feed URL on its own site, and the pack sets data-weather from it, uses its sunrise and sunset for dawn and dusk, and never shows a stale observation. Helpers for producing the feed from Open-Meteo are included. Ambient p…

Read the release notes

data-watch-page

Mark a button as the watch toggle for the current page. Stores a content hash; on revisit, fires a watch notification when content has changed.

Overview

Add data-watch-page to any <button> to make it a per-page bookmark + change-watcher. Click toggles between “Watch” and “Watching.” State persists per-URL via VBStore.

On every subsequent visit the script recomputes a content hash of the page’s <main> (or <article>); if it differs from the stored hash, a notification-wc:new event fires so <notification-wc> can surface the change. The watch list itself appears in the notification panel’s “Watching” tab.

This is the internal equivalent of GoodURL’s outbound link health monitoring — it watches your own pages for content drift, not other sites’ URLs.

Markup

Place the button anywhere — <page-tools> is the conventional home, but any DOM location works. The script lazy-loads when it sees the attribute on the page.

The script swaps the <icon-wc> name (bookmark ↔ bookmark-check), sets aria-pressed, and swaps the inline text label (Watch for updates ↔ Watching). To keep your own label, add data-watch-label-locked.

Override the strings per button for other languages:

AttributeDefaultUsed for
data-label-watchWatch for updatesText when the page is not watched
data-label-watchingWatchingText when the page is watched
data-label-actionWatch this page for content updatesTitle, and accessible name for icon-only buttons
data-label-stopStop watching this pageSame, when watched

What gets stored

VBStore namespace watches, key = the normalised page path (/x, /x/ and /x/index.html all share /x; older keys are migrated on first read). Each entry:

The hash deliberately covers only <main> (or the first <article>) so nav/footer/sidebar churn doesn’t trigger false positives.

Events

EventDetailWhen
page-watch:add{ entry }User clicked Watch
page-watch:remove{ url, subscriptionId }User clicked Unwatch (in the button or in the notification panel’s Watching tab)
notification-wc:new{ notification }Page revisit detected a hash change — type is watch. Every <notification-wc> on the page shows it in the bell; unwatching from the bell also unsubscribes on the server when server-sync is on and resyncs every watch button.

Server-side sync (opt-in)

If your site has a /go/notify backend, you can mirror watches server-side so the system can notify users between visits (e.g., via email). Opt in with a meta tag or a global flag:

When enabled, the watch button additionally POSTs /go/notify/subscribe with { url, type: "page-watch", notify: ["panel"] } on watch, and DELETEs the subscription on unwatch. Failures are logged to the console; the local watch still works regardless.

Accessibility

  • The button uses aria-pressed to expose watched/unwatched state to assistive tech.
  • title updates to describe the next action (“Watch this page for content updates” vs. “Stop watching this page”).
  • Operates as a normal <button> — native keyboard activation, focus styles, and screen-reader announcements come for free.

Related

↑