Lucky-Fetch

LuckyFetch

LuckyFetch is a local-first Chromium extension that automatically reloads selected tabs on independent schedules and can watch visible page text for multiple keywords or phrases. It provides the reliable reloader foundation for Chrome and Edge; Adds local transition-based keyword monitoring, match-any keyword lists and optional safe highlighting. It has no backend, analytics, telemetry, remote code, or external services.

Phase 1

The Phase 1 boundary and later ideas are in PRODUCT.md.

Phase 2A + Phase 2B.1 keyword monitoring

Scanning happens only after a completed load for a tab whose monitor is Running and whose keyword monitoring is enabled. Reload Now follows the same completed-load and delayed-scan lifecycle. Scanning never increments the reload count, changes the reload deadline, or creates another reload loop.

Immediately before each scan, Lucky Fetch discovers the tab’s current frame tree and runs a compact local match in each accessible frame. The tab is Present when any frame matches. It is Absent only when every expected frame completed without a match. If a frame disappears, cannot be injected, or lacks permission, the popup reports a Partial scan and preserves the last known state; an uncertain scan cannot produce a Lost alert. Frame results contain only match metadata, and Found/Lost transitions are evaluated once at the tab level.

Keyword settings are locked while the monitor is Running. Pause or Stop to edit them. Adding, removing, reordering, or changing a keyword, changing mode, or changing case sensitivity resets the baseline; changing only the monitor name, delay, after-detection action, or highlight setting preserves it. Start always resets the baseline conservatively, while Resume preserves it and waits for the next completed load. Pause preserves the last highlights; Stop removes them.

Saved Phase 2A records migrate locally and idempotently from keyword to keywords[]. Valid running monitors retain their tab-level baseline and history; highlighting, bring-to-front, and auto-open all default off. Corrupt legacy values are disabled safely rather than interpreted as page content.

Install in Chrome

  1. Run npm install and npm run build.
  2. Open chrome://extensions.
  3. Enable Developer mode.
  4. Choose Load unpacked.
  5. Select the generated dist folder.
  6. Pin LuckyFetch from the Extensions menu if desired.

Install in Microsoft Edge

  1. Run npm install and npm run build.
  2. Open edge://extensions.
  3. Enable Developer mode.
  4. Choose Load unpacked.
  5. Select the generated dist folder.

Development commands

npm run dev
npm run build
npm run test
npm run lint
npm run typecheck
npm run package

npm run dev starts Vite for popup/test-page development. Browser extension APIs are available only when the built extension is loaded in Chrome or Edge, so use npm run build and reload the unpacked extension for end-to-end checks.

The interaction test page is available at http://localhost:5173/test-page/ while Vite is running. It contains scrolling and editing controls whose unsaved values make unexpected reloads obvious.

Build and package

npm run build produces the loadable extension in dist/.

npm run package rebuilds the extension and writes:

package-output/luckyfetch-v0.2.0.zip

The ZIP contains the contents of dist at its root and can be extracted and loaded as an unpacked extension.

Permissions

LuckyFetch requests only extension capabilities needed for the implemented phases:

There is no required <all_urls> host permission and no install-time access to every website.

Reload Now behavior

For a running monitor, Reload Now performs an immediate reload, counts it, and resets the next deadline to one full interval from the request. For a paused or stopped monitor, it counts the reload but preserves the paused/stopped state. Reload Now uses normal caching if there is no saved monitor.

Recovery and diagnostics

The popup never waits indefinitely for the service worker. If active-tab lookup or background communication does not settle within four seconds, LuckyFetch shows a recoverable error screen with:

Reset monitor for this tab removes the saved monitor, verifies that its deterministic reload and scan alarms were canceled, removes its tab-instance token, and clears that tab’s badge. If the background worker cannot respond, the popup performs the same cleanup directly through extension storage and alarms.

The diagnostics panel compares popup state, local storage, Chromium alarms, the current tab, and the background worker’s in-memory state. Diagnostic data stays local unless the user explicitly copies it.

For development cleanup, open Show diagnostics and choose Reset all monitors. This clears saved monitors and per-tab reload/scan alarms after confirmation.

Known limitations

Future phases may add Match All, AND/OR expressions, exact/whole-word/regular-expression modes, sound, optional focus behavior, DOM-stability or continuous monitoring, selected-area/HTML/shadow-DOM scanning, Changed mode, auto-click, schedules, and explicitly authorized integrations. These are not part of Phase 2B.1.

Reporting a bug

Please include the browser and version, extension version, page scheme/domain (omit sensitive paths), monitor settings, expected behavior, observed behavior, and reproducible steps. Do not include private form data or page content.

See TESTING.md for the verification checklist.