Skip to content

Capture Pipeline

The Glassy Companion browser extension turns any browser tab into a one-keystroke feed for your Glassy workspace. Every capture — page, quote, element, or screenshot — travels through the same reliable pipeline before landing in your library.

What You Can Capture

Type How to trigger What lands in Glassy
Full page Ctrl+Shift+G (Quick Save) URL, title, full-page Markdown via Mozilla Readability, AI-generated tags
Text selection / highlight Select text → right-click → Save to Glassy Quoted text + source URL, formatted as a blockquote
Page element Element Picker → click any element Rich Markdown of that DOM element, CSS selector persisted
Screenshot Screenshot button in popup Viewport image uploaded as WebP; Smart capture auto-expands with image pre-loaded
Quick note Ctrl+Shift+N Blank note composer, no page context required

Keyboard Shortcuts

Action Shortcut (Windows/Linux) Shortcut (Mac)
Quick Save current page Ctrl+Shift+G Command+Shift+G
Open popup Ctrl+Shift+B Command+Shift+B
Quick Note Ctrl+Shift+N Command+Shift+N
Toggle Side Panel (Chrome only) Ctrl+Shift+P Command+Shift+P

How the Pipeline Works

Step 1 — Intent captured

You press a shortcut or click the toolbar button. The service worker receives the intent (a SAVE_CAPTURE or SAVE_PAGE message) and decides how to route it.

Step 2 — Offscreen document takes over (Chrome)

On Chrome (Manifest V3), the service worker hands the capture to a persistent offscreen document (offscreen.js). This document lives outside the 30-second service-worker kill window, so even a slow-loading page or large image won't cause a mid-capture failure. The service worker is a pure broker; it never does the heavy work itself.

On Firefox, the same pipeline runs inside the service worker (Firefox MV2 has no kill window, so no offscreen document is needed). One codebase, two safe paths.

Step 3 — Content script extracts metadata

The offscreen document (or SW on Firefox) asks extractor.js in the active tab to pull: - <title>, Open Graph tags, meta description - Schema.org JSON-LD (author, publish date, content type) - Page content via Mozilla Readability, scored by text density and link ratio

If extractor.js encounters an error, it reports it via a CONTENT_SCRIPT_ERROR telemetry message rather than silently swallowing it. The popup never hangs on extraction failure.

Quality gate (v2.8.0+)

After extraction, getStructuredContent() applies a quality gate before promoting the result to Markdown:

  • Candidate content containers are scored by text density — navigation-heavy or link-dense sections are down-ranked.
  • If the best candidate yields fewer than 200 meaningful characters (after stripping URLs and whitespace), the content result is discarded and the capture falls back to a clean bookmark instead.
  • This prevents junk captures on SPA dashboards, app shells, and other pages with minimal readable text — saving the Glassy dashboard itself now produces a bookmark, not a note containing a lone decorative image.
  • Decorative images (role="presentation", role="none", aria-hidden="true", or dimensions ≤ 2 px) are filtered from the Markdown output — tracking pixels and background images never appear in your captures.

Step 4 — Premium Markdown assembled

capturePipeline.js (shared between both execution paths) builds the canonical capture item:

# Article title

**Source:** https://example.com/article
**Canonical:** https://example.com/article
**Author:** Jane Smith
**Published:** 2026-05-15
**Captured:** 2026-06-01

---

*AI summary if enabled*

---

*Page body in clean Markdown...*

The header is assembled idempotently — re-capturing the same page never doubles the header section.

Step 5 — Screenshot capture (if requested)

When you click the Screenshot (📸) button:

  1. The extension captures the visible viewport as a base64 PNG via direct service-worker routing — no content-script relay required.
  2. The popup auto-expands Smart capture with the captured image pre-loaded — no second popup open required (v2.8.0+; unified in v2.12.0 as inline progressive disclosure, no screen swap).
  3. When you save, the image is sent to POST /api/ext/capture-image on your Glassy instance; the server converts it to WebP and stores it at uploads/captures/.
  4. The returned URL is embedded as ![Screenshot](url) in the capture Markdown.

The upload resolves against your configured instance URL — whether that's app.glassy.fyi, clear.glassy.fyi, or a self-hosted server. If you cancel before saving, no image is left on the server (upload is deferred until you actually save).

Step 6 — Saved to Glassy (or queued offline)

The assembled capture item is sent to POST /api/captures on your Glassy server. If the server is unreachable (offline, server restart, flaky network), the capture is added to the offline queue instead. See Offline Behavior for details on how retries work.

Premium Markdown Format

Every save from the Companion uses high-fidelity Markdown formatting:

  • # Title — extracted or user-edited
  • Source, Canonical, Author, Published metadata
  • Clean body copy — ads, nav, footers stripped
  • Your personal note appended at the bottom
  • Screenshots embedded inline as ![Screenshot](url)

This format renders beautifully in Glassy's editor, in Obsidian (via vault sync), and in any standard Markdown viewer.

Smart Capture Presets

The unified Save Card offers 4 structured content types that shape the capture's metadata and layout. Tap the "⚙ Smart capture" toggle to expand the preset chips, then choose a type. Type chips re-run the page interpreter on change so metadata is always fresh before save:

Type Best for Structured metadata
Article Long-form editorial content abstract, doi, language
Video YouTube, Vimeo, streaming pages videoId, provider, channelName, duration
Repo GitHub/GitLab repositories owner, repo, stars, language, license, topics
Bookmark Quick URL save with tags

Rule Engine (Settings → Rules) can auto-assign a type based on URL pattern or domain — so github.com/* always arrives as a Repo capture.

Browser Support

Browser Capture path Side Panel
Chrome 120+ Offscreen document (MV3)
Edge 120+ Offscreen document (MV3)
Brave / Arc / Opera Offscreen document (MV3)
Firefox 121+ Service worker (MV2 fallback) — (popup only)

Both paths produce identical capture items using the shared capturePipeline.js module.