惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Martin Fowler
Martin Fowler
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
A
About on SuperTechFans
Apple Machine Learning Research
Apple Machine Learning Research
The Register - Security
The Register - Security
Vercel News
Vercel News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
人人都是产品经理
人人都是产品经理
MyScale Blog
MyScale Blog
云风的 BLOG
云风的 BLOG
博客园_首页
U
Unit 42
T
Tailwind CSS Blog
G
GRAHAM CLULEY
F
Full Disclosure
V
Vulnerabilities – Threatpost
T
Tenable Blog
月光博客
月光博客
P
Privacy & Cybersecurity Law Blog
P
Privacy International News Feed
K
Kaspersky official blog
Scott Helme
Scott Helme
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
N
News and Events Feed by Topic
T
The Exploit Database - CXSecurity.com
N
News and Events Feed by Topic
有赞技术团队
有赞技术团队
Recent Commits to openclaw:main
Recent Commits to openclaw:main
L
LINUX DO - 最新话题
Recorded Future
Recorded Future
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Help Net Security
Help Net Security
The GitHub Blog
The GitHub Blog
Cisco Talos Blog
Cisco Talos Blog
SecWiki News
SecWiki News
P
Proofpoint News Feed
Security Latest
Security Latest
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
罗磊的独立博客
S
Security Affairs
M
MIT News - Artificial intelligence
L
LINUX DO - 热门话题
美团技术团队
Simon Willison's Weblog
Simon Willison's Weblog
T
Threat Research - Cisco Blogs
Stack Overflow Blog
Stack Overflow Blog
Forbes - Security
Forbes - Security
Hugging Face - Blog
Hugging Face - Blog
博客园 - Franky
V
Visual Studio Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
I built Snipworth a Chrome extension to turn code into shareable images — and keep them for later
AlexTDev · 2026-05-31 · via DEV Community

If you share code on social media, you've probably used Carbon, ray.so, or Snappify at some point. They turn a snippet into a nice image, you download it, you post it. That's where they stop.

The thing I kept running into wasn't generating the image — it was everything around it. I'd write a snippet I wanted to post, but not right now. I'd tweak the colors, get it looking good, then have nowhere to put it. Next time I needed it, it was gone, and I'd start over.

So I built Snipworth: a Chrome extension that turns code into polished images, but treats the snippet itself as something worth keeping. It's on the Chrome Web Store at v1.1.0, open-source under MIT.

Chrome Web Store listing


Why build yet another code-screenshot tool?

Two reasons, honestly.

The first was practical. I post code on X and LinkedIn fairly often, and the generate-download-post loop never fit how I actually work. I wanted a place to draft snippets — write one now, refine it later, keep a few around just for myself — instead of treating every image as throwaway.

The second was learning. I had never built a browser extension, never touched Manifest V3, never published anything on the Chrome Web Store. Rather than a throwaway tutorial project, I picked a real problem I had and built the whole thing end to end — domain model, UI, export pipeline, CI, store submission.

The existing landscape looked like this:

  • Carbon / ray.so — great-looking output, web-based, but stateless. No library, no persistence, nothing social-media-aware beyond the image.
  • Snappify — feature-rich and polished, but commercial and account-based.
  • Editor extensions (CodeSnap & co.) — handy inside one editor, but tied to it.

The gap I went for: an open-source, local-first browser extension where generating the image is just one step, and the real product is managing your snippets — code, image, caption, hashtags, target platform, all kept together.


What does it do?

Snipworth lives in a Chrome side panel that stays open while you browse, and in a full-tab mode for when you want room to work. Both run the exact same React app.

Capture code from anywhere

Paste a snippet, or select code on any page, right-click, and hit "Snipworth this code". It lands in the editor ready to style.

Syntax highlighting + language auto-detection

Highlighting is powered by Shiki, so you get VS Code-grade themes. The language is auto-detected, with a one-click override when the guess is wrong. The UI shows the language actually used.

Editor with auto-detected language badge + the language picker open

One-click formatting

A single click runs Prettier over your snippet — JavaScript/TSX, JSON, CSS, HTML, Markdown, YAML, GraphQL, and more. Messy paste in, clean snippet out.

Style it, then export

Theme (dark/light), monospace font, size, background, padding — all adjustable with a live preview. When it's ready, copy straight to the clipboard or download as PNG or SVG at 1×, 2×, or 4×.

The editor view

The library — the part I actually built this for

Every snippet can be saved as a draft. The library is a grid of everything you've kept: filter by platform, language, status, or tags; archive the ones you're done with; come back and refine the rest. Post them when you're ready, or just keep them around — a personal shelf of code you liked.

Library view

Social-media presets

Each draft carries a target platform with the right preset baked in — dimensions, aspect ratio, character limit — plus a caption and hashtags. Pick X, LinkedIn, Instagram, story, or thread, and the export comes out at the correct size for that feed.

Your data is yours

Everything is stored locally in IndexedDB — no account, no server, no tracking, nothing leaves your browser. And you can export your whole library to a JSON file to back it up or move it to another machine.


How it works under the hood

The interesting part of this project wasn't any single feature — it was trying to build it as cleanly as I could. I used Snipworth as an excuse to apply Clean Architecture and Domain-Driven Design properly, on a real codebase, instead of just reading about them.

The dependency rule

The code is split into four layers, and source-code dependencies only ever point inward:

infrastructure → adapters → application → domain

  • domain/ — the heart. The Draft aggregate, value objects, business rules. Zero imports from anything outside: no React, no Dexie, no chrome.*, no Shiki. It doesn't know it's running in a browser.
  • application/ — use cases, one per user-meaningful action (SaveCurrentEditorAsDraft, CopySnippetAsImage, UpdateDraft…). They orchestrate the domain and talk to the outside world only through ports.
  • adapters/ — the implementations of those ports. Shiki, html-to-image, Dexie, the clipboard, chrome.* — every concrete technology lives here.
  • infrastructure/ — wiring and bootstrap.

Design architecture

Everything external is a port

The domain and use cases never call a library directly. They depend on small interfaces they define themselves — SyntaxHighlighter, FontPreloader, ImageExporter, DraftRepository, ClipboardCopier, plus Clock and IdGenerator so time and IDs are injected rather than ambient.

This paid off in concrete ways:

  • The side panel and full tab share one bundle — there's a single source of truth for behavior, and nothing UI-specific leaks into the core.
  • Swapping a technology is an adapter change, not a rewrite. If I ever replace html-to-image, or move off Shiki, the domain doesn't notice. (The same goes for a future Firefox port — the chrome.* calls are all behind adapters.)
  • I can test the whole application without booting a browser. Use cases run against hand-written fakes for the ports and an in-memory IndexedDB. The tests describe behavior ("when a draft is saved, it can be found again"), not implementation, so they survive refactors.

Where MV3 constraints met the architecture

A few Manifest V3 realities shaped the port boundaries in ways I didn't expect:

  • Clipboard copy must preserve the user gesture. If you await the rendered blob before constructing the ClipboardItem, the gesture has expired and the copy silently fails. The trick is to hand the Promise<Blob> directly to ClipboardItem — so the ClipboardCopier port is shaped around a promise, not a resolved blob.
  • Fonts must be preloaded before every export, or the first image of a session renders with system fallback fonts. That's a FontPreloader port the export use case always calls first.
  • Highlighting goes HAST → React elements, never an HTML string. Shiki returns a syntax tree; the UI converts it to React nodes. Safe by construction — no dangerouslySetInnerHTML anywhere.
  • The service worker keeps no long-lived state. MV3 kills it after ~30s idle, so anything that needs to survive goes to IndexedDB or chrome.storage. The worker is a router, nothing more.

What I learned

This was my first extension, my first Manifest V3 project, and my first Chrome Web Store submission. A few things stood out.

Manifest V3's CSP means everything is bundled

No remote code. At all. Shiki grammars, themes, the WOFF2 fonts, Prettier — all shipped inside the extension. No <script src="https://…">, no dynamic import() against a URL. It's a real constraint, but it also means the extension works fully offline.

Shiki without WebAssembly

Shiki normally uses an Oniguruma WASM regex engine. That would have forced wasm-unsafe-eval into the manifest and added ~600 KB. I switched to Shiki's pure-JS regex engine instead — slightly slower on dense grammars, but no WASM, a smaller bundle, and a cleaner manifest. I lazy-load grammars and themes on demand so the core install stays light.

The architecture earned its keep

I went in worried the layering would feel like overkill for an extension. It didn't. The moment the side panel and full tab needed to share logic, the moment I wanted to test export without rendering an actual image, the moment an MV3 quirk needed to be quarantined in one place — the boundaries were already there. Discipline up front, less thrash later.

Test the behavior, not the wiring

I leaned on sociable tests through the use cases — real domain objects, hand-written fakes only for the ports — instead of mocking everything. The suite reads like a spec and doesn't shatter every time I move a method. That, more than anything, kept the refactors cheap.


Try it out

If you post code on social media, give it a try:

It's open-source, free, local-first, and I'm actively working on it. If something's missing, broken, or could be better — open an issue or drop a comment. It's still early, and feedback genuinely helps.


If you want to support the project, you can buy me a coffee ☕.