# CleanShot Embed An Obsidian plugin that renders [CleanShot](https://cleanshot.com) share URLs (`cln.sh/XXX`) as inline images in reading view. ## Why? CleanShot share URLs are permanent, but they link to a landing page — not a direct image. The direct image URL is a signed CloudFront URL that expires. Downloading images locally wastes your Obsidian Sync storage quota. This plugin fetches a fresh signed URL at render time and displays the image inline. No files are stored in your vault. ## How it works - **MarkdownPostProcessor** intercepts rendered HTML in reading view, finds CleanShot links, and replaces them with `` elements. - **`requestUrl`** from the Obsidian API fetches the CleanShot share page (bypasses CORS). - **Extracts the signed image URL** from the page's embedded JSON data. - **In-memory cache** avoids refetching the same URL on re-renders. Cleared on plugin unload. - **Graceful fallback** — if the fetch fails, shows the original URL as a clickable link. ## Usage 1. Paste a CleanShot share URL (e.g. `https://cln.sh/LQtyfqN5`) into any note 2. Switch to **Reading View** — the URL renders as an inline image 3. Click the image to open the original share page in your browser ## Supported URL formats - `https://cln.sh/XXXX` - `https://share.cleanshot.com/XXXX` ## Installation ### From Community Plugins Search for "CleanShot Embed" in Obsidian Settings > Community Plugins. ### Manual 1. Copy `main.js`, `manifest.json`, and `styles.css` into `.obsidian/plugins/cleanshot-embed/` 2. Reload Obsidian 3. Enable "CleanShot Embed" in Settings > Community Plugins ## Notes - Desktop only (`requestUrl` CORS bypass is not available on mobile) - Images are never saved to your vault — zero impact on Obsidian Sync storage - Signed URLs are fetched fresh each session, so images continue to work even after CloudFront URLs expire