A lightweight Chrome extension that overrides the browser new-tab page and shows recent Shopify/web-development YouTube videos.
- Replaces Chrome's default new tab with a custom page (
newtab.html). - Fetches video feeds from curated YouTube channels via RSS/Atom (no API key required in the main path).
- Groups videos by publish date and renders them as cards.
- Supports category filtering and manual refresh.
- Caches fetched videos in
localStorageto reduce network calls.
- Stack: plain JavaScript (ES modules), HTML, CSS.
- Platform: Chrome Extension, Manifest V3.
- Background: service worker (
background.js) with minimal install log behavior. - UI runtime: all app logic runs in
newtab.js. - No build step, package manager, or test runner in this repo.
manifest.json- extension metadata, permissions, new-tab override, service worker.newtab.html- page shell and UI containers.newtab.js- core app logic (fetching, caching, filtering, rendering).channels.js- curated channel list, blocked list, fallback channels.style.css- UI styling for header, filter, cards, grouped sections.background.js- install lifecycle listener only.
DOMContentLoadedinnewtab.jsinitializes controls and category options.- App checks cache validity (
isCacheValid) using timestamp inlocalStorage. - If cache is valid, cached videos render immediately.
- Otherwise
getAllVideos(category)fetches channel feeds in parallel. - Feed XML is parsed into normalized video objects.
- Results are merged, blocked channels removed, sorted by newest, truncated to max.
- Videos are cached and displayed.
- A periodic timer checks cache expiry and auto-refreshes when needed.
- Keys:
shopify_videos_cacheshopify_videos_timestampselectedCategory
- Duration: 1 hour (
CACHE_DURATION). - Auto-check interval: every minute, refreshes once cache is stale.
- Manual refresh button clears cache and force-fetches.
- Categories are derived dynamically from
CHANNELS+FALLBACK_CHANNELS. - Default selected category prefers
shopifywhen available. - Update
channels.jsto add/remove channels or categories. BLOCKED_CHANNELScan filter out unwanted channel titles during display prep.
- Open Chrome and go to
chrome://extensions. - Enable Developer mode.
- Click Load unpacked and select this project folder.
- Open a new tab to test the extension UI.
- Use DevTools on the new tab page to inspect logs/errors.
If you are an AI coding assistant, use this checklist before editing:
- Read
manifest.jsonfirst to understand extension entry points. - Read
newtab.jssecond; this is the primary behavior file. - Read
channels.jsfor content scope and categorization. - Keep changes minimal and local; there is no build pipeline to catch mistakes.
- Validate by reloading the unpacked extension and opening a new tab.
- UI copy/layout tweaks:
newtab.html - Styles/visual polish:
style.css - Channel curation and categories:
channels.js - Fetch/caching/render logic:
newtab.js
- Extension loads without manifest errors.
- New tab page renders and does not stay stuck on "Loading...".
- Category dropdown populates and switching category updates videos.
- Refresh button triggers new fetch and re-render.
- Console has no uncaught runtime errors.
newtab.jscontains legacy helper functions that reference undeclared constants (for example variables related to YouTube API key usage). They are currently unused by the active RSS flow; avoid calling or wiring them without cleanup.- Relevance filtering currently returns all titles (
isRelevantVideohas filtering disabled intentionally). - Cache helpers currently support both object and legacy array shapes when reading cached data.
- Remove or isolate unused legacy YouTube API helper code.
- Add lightweight smoke tests (or at least scripted manual verification docs).
- Add empty/error states for no videos found per category.
- Normalize blocked channel filtering to use channel ID instead of title for reliability.