Dev.to WebDev 🛠 Dev 👁 0 📖 3 min read

Why the download button waits for your tap

Paste a TikTok link into ramrom.io, and nothing happens. No spinner, no automatic resolve, no file dropping into your downloads folder. The page just waits. That is deliberate, and it is one of the easiest decisions I ma

Paste a TikTok link into ramrom.io, and nothing happens. No spinner, no automatic resolve, no file dropping into your downloads folder. The page just waits. That is deliberate, and it is one of the easiest decisions I made while building the site.

The temptation to auto-download is real. Every downloader I tested before building mine did something on paste. It felt slick in a demo: paste, and the video is already on its way. So when I wired up the paste event on the link box, my first version did the obvious thing. Paste a link, and the page fired the resolve call straight away, then started the download the moment a file URL came back. It worked. It also felt wrong the first time I used it for real.

The first problem is that a paste is not a decision. People paste a link to check it, to compare it, to see whether the site even supports that platform. Sometimes they paste the wrong link entirely — a share URL copied in a hurry, or a link to a private video. If the site has already fired a resolve call, that mistake has cost an API call. My provider quota is a free tier with a hard monthly ceiling, and every resolve costs one call whether the visitor wanted the file or not. Auto-downloading turns every curious paste into a paid action. Waiting turns it into a free one.

The second problem is the file itself. Browsers treat a download triggered by script differently from one triggered by a click. A programmatic download that fires without a user gesture is the behaviour of a pop-up ad, and browsers know it. Chrome will sometimes block it outright, and even when it does not, the file lands in the downloads folder with no warning. On a phone, which is where most of my visitors are, a surprise download is worse: mobile data, a file the person did not ask for, and no obvious way to cancel it. A tap on a button is a clear gesture. The browser trusts it, the visitor expects it, and the download starts because somebody asked for it.

So the flow on ramrom.io is deliberately slow in exactly one place. Paste the link and the page cleans it up — stray spaces, line breaks, tracking parameters — and validates that it is a platform I support. That part is free and instant. Then it stops. The resolve call, the one that spends quota, only runs when the visitor taps Download. The quality dropdown only appears after the resolve comes back, so nobody picks a format for a file that does not exist yet.

There is a small detail inside this that matters more than it looks. The paste event itself does not fire the resolve, but it does read the clipboard text from the event, which the browser allows without asking for clipboard permission. Asking for permission would add a prompt the visitor did not ask for, and the paste event already hands me the text. The button then does the rest. Two gestures, two jobs: paste gives me the link, tap gives me the instruction.

I have had visitors ask why the site does not just start the download. The honest answer is that I would rather one extra tap than one surprise file. A downloader that starts downloading before you ask is a site you cannot trust with your clipboard, and trust is the only thing a free tool without accounts has. No sign-up, no cookies, no auto-download. The button waits because the visitor should be the one who decides.

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.