cd /news/developer-tools/a-browser-bookmarklet-that-instantly… · home topics developer-tools article
[ARTICLE · art-38466] src=gist.github.com ↗ pub= topic=developer-tools verified=true sentiment=· neutral

A browser bookmarklet that instantly downloads your current clipboard content into a file (.md, .js, .html, .py, .rs, .css etc).

A developer created a browser bookmarklet that instantly downloads clipboard content into a file with a specified name and extension, supporting formats like .md, .js, .html, .py, .rs, and .css. The tool prompts for file name and extension, then creates and downloads the file without server interaction.

read1 min views5 publishedJun 24, 2026

| javascript:/* Clipboard to File Bookmarklet %7C Any format */(async()=>%7Btry%7Bconst e=await navigator.clipboard.readText();if(!e)return void alert('Clipboard is empty or inaccessible.');let t=prompt('File name (without extension):','my_code');if(!t)return;let r=prompt('File extension (e.g., txt, json, md):','txt');if(!r)return;r=r.toLowerCase().trim().replace(/%5E./,'');const a=new Blob([e],%7Btype:'text/plain;charset=utf-8'%7D),o=URL.createObjectURL(a),c=document.createElement('a');c.href=o,c.download=%60$%7Bt%7D.$%7Br%7D%60,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(o)%7Dcatch(e)%7Balert('Error: Unable to access clipboard.'),console.error(e)%7D%7D)(); |

── more in #developer-tools 4 stories · sorted by recency
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/a-browser-bookmarkle…] indexed:0 read:1min 2026-06-24 ·