DEV Community

Cover image for A browser can be more than a download page
Ajay Shukla
Ajay Shukla

Posted on

A browser can be more than a download page

Receiving a folder of files usually creates another small task.

Download the file. Find it on the device. Open the appropriate application. Inspect its contents. Repeat for the next file.

That workflow is familiar, but it is not always necessary.

For many commonly used formats, a browser can provide enough context to inspect the content before deciding whether a local copy is needed.

This is the idea behind in-browser file previews.

Inspect before downloading

Consider a project folder containing images, video clips, audio, PDF documentation and Markdown notes.

A recipient may not need to download everything.

They may only need to:

  • Check an image at its original resolution.
  • Inspect a video and move to a particular point.
  • Listen to an audio recording.
  • Read a PDF report.
  • Review a Markdown document.
  • Inspect a code or configuration file.

A browser-based preview can make those tasks more direct.

Different formats need different viewers

Images need a responsive viewer and a way to inspect detail.

Video and audio need playback controls. They also benefit from seeking, which is why byte-range support matters: the browser can request portions of a media file rather than treating the whole file as one download.

PDFs need a document reader that works on desktop and mobile.

Markdown needs more than plain text. Tables, task lists, headings and code blocks should retain their structure.

Code files need readable formatting, preserved indentation and a convenient way to copy the original content.

A good preview experience should account for what each file type is used for.

Where Local Bridge fits

Local Bridge includes an embedded browser preview viewer.

When a recipient opens a shared folder, supported files can be inspected directly in the browser without downloading them first.

The current preview support includes images, video, audio, PDFs, Markdown and code or text files.

For media, the browser uses native playback and byte-range requests for seeking. Markdown is rendered with GitHub Flavoured Markdown support, including tables, task lists and fenced code blocks.

The original file remains available to download when a local copy is needed.

Not every file is a preview

Some formats are intentionally presented as download-only items.

Archives, executables, disk images and Word documents such as DOCX are examples.

The browser can show basic file information and offer a download without pretending that every format has a suitable built-in preview.

There is also a security consideration.

Executable web formats such as HTML, SVG and JavaScript are displayed as source text in the preview viewer rather than being executed. This reduces the risk of running untrusted content in the shared browsing context.

A more useful recipient experience

The goal is not to eliminate downloads.

It is to make downloads a deliberate action rather than the first step for every file.

Recipients can inspect supported content, understand what they have been given and download the files they actually need.

Local Bridge provides that experience while serving the files from the sender's machine.

The host machine and its network connection must remain available while the share is active.

The distinction is simple: browsing a shared folder should help the recipient understand its contents, not force them to download everything before they can inspect it.

Explore file and media previews:

https://localbridge.theneritic.com/docs/previews

Local Bridge — by The Neritic.

Top comments (0)