Saving snippets from the web
Use the extension to capture SQL and code from anywhere on the web into your Cocobox library.
The fastest path from “I just found a useful query in a Slack thread” to “it’s saved, organized, and runnable” is the Cocobox extension.
Three ways to save
1. The floating button
Hover over a detected code block. The Cocobox button appears at the block’s top-right. Click Save.
The quick-save dialog shows:
- Detected language — editable.
- Snippet name — auto-suggested from the page title.
- Folder and tags — optional.
- Source URL — captured automatically; appears as the snippet’s
Sourcelink in the library.
2. Right-click on a selection
Highlight any text → right-click → Save to Cocobox. The extension classifies the selection and saves to your default folder.
If the selection contains SQL, you’ll be asked which dialect (defaulting to the detected one).
3. Drag-and-drop into the popup
Click the extension icon → drag any text or a .sql / .py / .js file into the popup. Same save dialog opens.
Language detection
For SQL: the extension uses keyword + clause heuristics tuned per dialect (MySQL, MariaDB, PostgreSQL, SQLite, MSSQL, Oracle, BigQuery). Accuracy is high on real-world snippets (>95% on a labelled benchmark).
For programming languages: a token-frequency model trained on a few thousand snippets per language. Confused detections (Java vs. Kotlin, JavaScript vs. TypeScript) lean conservative — when uncertain it picks the more general option.
You can always override before saving.
Default folder & tags
Settings → Default save target:
- Folder — defaults to “Inbox”.
- Tags — added to every saved snippet (e.g.
from-extension). - Visibility —
privateby default.
Auto-save toggle
Power users with high-volume capture: enable Auto-save in settings. Then, instead of opening a dialog, the extension saves silently with the defaults and shows a toast — undoable for 8 seconds.
Where it ends up
Saved snippets land in your library at cocobox.io/snippets, ready to be opened in the editor, bound to a connection, or shared.