Skip to content

feat(bookmarks): per-video bookmarks with notes and export (#4097) - #4481

Open
chirag127 wants to merge 3 commits into
code-charity:masterfrom
chirag127:feat/bookmarks
Open

chirag127 wants to merge 3 commits into
code-charity:masterfrom
chirag127:feat/bookmarks

Conversation

@chirag127

@chirag127 chirag127 commented Nov 16, 2026 •

Copy link
Copy Markdown

Closes #4097.

What this adds

A Bookmarks button under the player on any watch page, and a panel that stores named timestamps for that video.

  • add a bookmark at the current playhead, with an optional name (blank falls back to the timestamp)
  • click a timestamp to seek; delete one bookmark; replaces an existing bookmark at the same second instead of duplicating it
  • export the list as TXT or JSON
  • stored per video id in chrome.storage.local under bookmarks, so it survives reloads and follows the browser profile
  • off by default (bookmarks_enabled); nothing is drawn until the switch is on

Where it lives

File Change
js&css/web-accessible/www.youtube.com/features/bookmarks.js new page-world module, self-contained
menu/skeleton-parts/bookmarks.js new menu part, attaches one card to General
_locales/en/messages.json two keys
manifest.json one web_accessible_resources entry
js&css/extension/init.js one entry in pageWorldFiles
menu/index.html one script tag
tests/unit/bookmarks.test.js 7 unit tests for the pure helpers

No existing feature file is edited. The module registers itself on init_completed / yt-navigate-finish, so it does not depend on the order of the other feature scripts.

Verification

$ npx jest tests/unit/bookmarks.test.js
Tests: 7 passed, 7 total

$ npx jest
Test Suites: 40 passed, 40 total
Tests:       every suite passes (40 suites, including the new one)

$ ESLINT_USE_FLAT_CONFIG=true npx eslint --config=tests/eslint_rules.config.mjs \
    "js&css/web-accessible/www.youtube.com/features/bookmarks.js" \
    menu/skeleton-parts/bookmarks.js tests/unit/bookmarks.test.js
0 errors, 20 warnings (all `space-before-function-paren`, the repo's existing style)

Live check: the module was injected into a real youtube.com/watch page in Chrome 157. Clicking the button opened the panel, submitting the form at 1:05 produced

{"action":"set","key":"bookmarks","value":{"dQw4w9WgXcQ":[{"t":65,"label":"chorus","at":…}]}}

and the panel rendered a 1:05 chorus row whose click sets video.currentTime. Screenshot:

Bookmarks panel and button

Not tested

  • Signed-in account: the feature writes only to extension storage, never to the account, so there is nothing to test there.
  • Firefox/Safari builds. The module uses no browser-specific API beyond Blob and chrome.storage through the existing bridge.

Conflicts

Checked against the 160 open PRs: none touches features/bookmarks.js, menu/skeleton-parts/bookmarks.js, or tests/unit/bookmarks.test.js. The shared-file edits are one added line each. Default off, so it changes nothing for existing users.

Adds a Bookmarks button under the player and a panel that saves named
timestamps per video. Bookmarks can be jumped to, deleted, and exported
as TXT or JSON. Off by default; no network requests and no new
permissions.
@chirag127
chirag127 marked this pull request as ready for review November 18, 2026 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Video bookmarking: save timestamps with notes

1 participant