跳到正文
DEV Community· Kevin Rusev·· 1 小時前AI 評分59

Capy Files 的 67 款檔案工具如何在不上傳檔案的情況下於瀏覽器運作

I built 67 file tools that never upload your files. Here's how the browser does it all

AI 導讀

Capy Files 的 67 款檔案工具在瀏覽器本機處理檔案,伺服器不會接觸用戶檔案。PDF、Office 轉 PDF、圖片、影音及 AI 功能使用 WebAssembly 或瀏覽器 API;AI 透過 Transformers.js 載入 ONNX 模型,條件許可時使用 WebGPU。

正文

Disclosure: I'm the founder of Capy Files. This post is about how it works, including the parts that were hard.

Most "free online PDF tools" work the same way: you upload your file to their server, they process it, you download the result. That's fine for a meme. It's less fine for a payslip, a contract, a medical letter or a client's tax return.

So I wanted to see how far a browser can go on its own. The answer turned out to be: almost all the way. Capy Files does PDF editing, redaction, compression, video trimming, background removal, OCR and transcription entirely on your device. The server never sees a file.

How to check that claim yourself

Don't take my word for it (or anyone's who says "we don't upload"):

  1. Open the tool, then open DevTools → Network.
  2. Add a file and run the job. You'll see no request carrying your file.
  3. Or simpler: load the page, turn your Wi-Fi off, then use the tool. It still works.

That second test is the honest one. If a site needs the network to process your file, your file is going somewhere.

What runs where

Everything happens in Web Workers, so the page stays responsive, and every engine is WebAssembly or a browser API:

  • PDFs: pdf.js to read and render, pdf-lib to write. Editing changes the PDF's own text lines rather than pasting a white box over them, and redaction removes the words from the file, not just from view.
  • Office to PDF: LibreOffice compiled to WebAssembly. Yes, the whole thing, in a tab. It's big, so it only downloads when you use it.
  • Images: the jSquash codecs (MozJPEG, WebP, AVIF, OxiPNG) from the Squoosh project, plus vtracer for image to SVG.
  • Video and audio: Mediabunny on top of WebCodecs. Trimming an MP4 or MOV is a remux, so it's instant and loses no quality. Compression uses the browser's hardware encoder where it can.
  • AI: ONNX models through Transformers.js, on WebGPU when available: BiRefNet for background removal, Whisper for transcription, PaddleOCR for text recognition.

The site itself is a pre-rendered React app on Cloudflare. The server's only jobs are serving files, sign-in and payments.

The parts that were hard

Model downloads. "No upload" for AI means the model comes to you instead. The background-removal model is ~86 MB, and Whisper is bigger. They're cached after the first run, but asking someone for 86 MB before they've seen a single result is a lot. So the AI pages now show a real result from a sample file before anything downloads.

Memory on phones. A 2 GB video can't sit in memory on a phone. Lots of the media work is about streaming instead of loading whole files, and about saying clearly when a device simply can't do a job.

Cross-origin isolation. Some engines need SharedArrayBuffer, which needs COOP/COEP headers, which then break third-party embeds and sign-in popups. Tool pages are isolated; the login and checkout pages aren't.

Updates vs. open tabs. This one bit me this week. Each tool starts a fresh worker per job, from a file whose name is hashed per build. Someone with a tab left open across a few deploys pressed "Cut" twelve times and got a crash every time, because their version's worker file no longer existed on the server. The fix: each deploy keeps the last week's versions around, and a tab older than that is told to reload instead of being blamed for running out of memory.

Offline. A service worker caches the app shell and the everyday engines, so the common tools work offline from the first visit, not just after you've used them once.

Is it free?

Most tools are free with no account. Some heavier jobs (bigger batches, the best-quality AI models, saving certain edits without a watermark) are part of Pro. That's how I keep the lights on without selling data, since there's no data to sell.

What I'd love feedback on

  • Tools you'd want that only exist as upload-based sites today
  • Browsers or devices where something breaks (Safari and older Android are the usual suspects)
  • Whether the "turn off your Wi-Fi" test is convincing, or whether you'd want something stronger

Try it at capyfiles.com, and tell me what breaks.

來源:DEV Community · dev.to