8000 feat(clipper): Lens web clipper browser extension, Chrome first by adeelahmad · Pull Request #277 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

feat(clipper): Lens web clipper browser extension, Chrome first - #277

Merged
adeelahmad merged 1 commit into
mainfrom
claude/project-thread-sin0jk
Oct 10, 2026
Merged

adeelahmad merged 1 commit into
mainfrom
claude/project-thread-sin0jk

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Description

Before: the only way to get a web page into Lens was to paste text or push its URL to an import webhook by hand.

After: a browser extension (Chrome first, in extensions/browser/) clips the page, the selection, or a part you pick into Markdown and sends it to Lens. It works like MarkDownload:

  • Page: the article via Readability, plus metadata (title, author, site, published date, lead image, keywords, language) from meta tags, Open Graph and JSON-LD.
  • Selection: keeps the list, table, quote or code block around it.
  • Picker: hover to outline, ↑/↓ to widen or narrow, then click or Enter.
  • Right-click a link to have Lens capture it, or an image to send it as a file.
  • Templates: {title|kebab}, {date:YYYY-MM-DD}, filters, YAML front matter (empty lines dropped), and a separate template for selections.
  • Markdown options: headings, bullets, fences, links, images, GFM tables.
  • Optional: send the images as files; ask Lens to capture the page as well.
  • Ways to use it: the popup for reviewing first, Copy, Download .md, keyboard shortcuts, and quick-send from the context menu.

How: everything goes through the existing POST /api/v1/hooks/import. Markdown is sent as JSON {text, title}, or as multipart when it includes images or the URL. You can add one import-hook token per namespace. Tokens stay in local storage and everything else syncs. Host permission is only asked for the Lens address you add. The shared core in src/core/ is plain WebExtension code (browser ?? chrome), and each browser is a targets/<name>.json manifest overlay, so the Firefox, Edge and Safari threads only add a target. A new Browser extension workflow tests, builds and zips each target as a run artifact, and the Release workflow now also starts it so the zips get attached to releases.

Motivation and Context

Adeel asked for a web clipper on every major browser; this thread owns the shared core and Chrome.

Steps to reproduce (if appropriate):

cd extensions/browser && npm ci && npm test && npm run build, then use Load unpacked on dist/chrome. In the options, add your Lens address and an import webhook token.

Checked end to end in headless Chromium with the built extension against a mock hook: the page clip, the popup send with its "Open in Lens" link, the picker, and the options Check.

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project.
  • I added or updated tests. (19 node:test tests with jsdom)
  • My change requires documentation updates, and I have updated docs/ accordingly. (docs/web-clipper.md)

🤖 Generated with Claude Code

https://claude.ai/code/session_018uA6PhZXrmpgsbfDh2W23u


Generated by Claude Code

A MV3 extension in extensions/browser: clip the page (Readability), the
selection or a picked element to Markdown with MarkDownload-style
templates, and send it to Lens through a namespace's import webhook.
Shared core for the Firefox, Edge and Safari targets; CI builds a zip
per target and attaches them to releases.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018uA6PhZXrmpgsbfDh2W23u
@adeelahmad adeelahmad self-assigned this Oct 10, 2026
@adeelahmad
adeelahmad merged commit b0d12b9 into main Oct 10, 2026
8 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-sin0jk branch October 10, 2026 20:18
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.

2 participants

0