A Chrome extension (Manifest V3) that converts webpages to clean Markdown using Turndown.js.
background/service-worker.js— context menus, keyboard shortcuts, message routing, injects content scriptcontent/content.js— HTML extraction, cleanup, Turndown conversion, front matter, statspopup/popup.js— UI controller for copy/download, mode toggles, stats displayoptions/options.js— settings persistence via Chrome storage sync APIlib/turndown.js+lib/turndown-plugin-gfm.js— vendored libraries (do not edit)lib/logger.js— debug logging stored inchrome.storage.local, exportable from options page
- No build step — plain JS, HTML, CSS loaded directly by Chrome
- All conversion logic lives in
content/content.js; keep it self-contained - User preferences stored via
chrome.storage.sync - No external API calls — everything runs locally in the browser
- Permissions are minimal:
activeTab,clipboardWrite,storage,contextMenus
- Turndown.js is vendored in
lib/, not loaded from a CDN - Content script is injected dynamically by the service worker, not declared in manifest
- Three conversion modes: main content extraction, full page, and selection
- Token count is estimated (chars / 4), not from a real tokenizer
- Load unpacked in
chrome://extensions/with Developer mode enabled - Test on diverse pages: articles, tables, code blocks, pages with heavy nav/ads
- Verify context menu, keyboard shortcut (Cmd+Shift+M), and popup all work