Using a Bookmarklet to Populate Legacy Government Web Forms

Sometimes, the simplest technology is the best solution.

If you've ever filled out a government form online, you've probably experienced this:

You spend 15-20 minutes entering information, move to the next page, and suddenly the website logs you out. Or worse, you encounter an unexpected error and lose your unsaved work.

This is especially frustrating with immigration applications, where forms can contain hundreds of questions about your personal information, travel history, employment, education, and family.

At Fillvisa, I've been working on making immigration forms easier to complete.

One particularly interesting engineering challenge has been transferring information from our modern web forms into government portals that weren't designed for third-party integrations.

The solution? A bookmarklet.

Yes, that old browser technology from the early days of the web. Here's why I chose it over building a browser extension, and how we're using it for immigration forms.

Table of Contents

The problem with government web forms

Let's take the U.S. Department of State's DS-160, the online application used for most U.S. nonimmigrant visas. The form is hosted on the Consular Electronic Application Center (CEAC), a legacy government web application. According to CEAC's own instructions, the website automatically times out after 20 minutes of inactivity, potentially causing users to lose unsaved information.

Although CEAC provides ways to save and retrieve applications, the experience can still be frustrating.

And DS-160 isn't the only example.

  • Schengen visa applications: Depending on the destination country, applicants may need to use country-specific online portals. France, for example, requires applicants to complete an online application through France-Visas.

  • USCIS online filing: The U.S. Citizenship and Immigration Services offers online filing for certain immigration forms, but users must still work through the agency's own application interface.

These systems have different architectures and limitations, but they share a common challenge: users must enter large amounts of information into government-controlled websites. For applicants, this means tedious data entry.

For immigration professionals managing dozens of clients, it means repeatedly transferring information they've already collected.

Why should someone have to enter the same information twice?

Why not just build a browser extension?

A browser extension seems like the obvious solution. You could build an extension that reads information from your application and automatically populates the corresponding fields on a government website. And for many use cases, browser extensions are excellent.

But they also introduce engineering and maintenance overhead.

1. Multiple browsers, multiple environments

Chrome, Firefox, Edge, and Safari have different extension APIs, implementation details, and distribution requirements. Although some code can be shared, supporting multiple browsers still requires additional development and testing.

2. Browser updates and changing extension APIs

Browser extensions aren't necessarily something you build once and forget. A good example is Google's transition from Manifest V2 to Manifest V3, which introduced substantial changes to extension architecture, background scripts, permissions, and security restrictions. Maintaining an extension can mean updating code, testing browser compatibility, and publishing new versions.

3. Distribution and installation

Extensions typically require browser-specific packaging, installation, permissions, and sometimes store approval. That's another layer of friction for the user. For a product like Fillvisa, where the objective is simply to transfer data into an existing government form, I started wondering:

Do we really need an entire browser extension for this?

Bookmarklets: old technology, surprisingly useful

A bookmarklet is essentially a browser bookmark containing JavaScript instead of a regular website URL. When you click the bookmark, the browser runs the JavaScript against the webpage you're currently viewing, subject to the browser's security restrictions. That means a bookmarklet can interact with the webpage's HTML, identify form fields, and populate them with information.

Here's a simple bookmarklet (click on it):

✈️ Fillvisa Bookmarklet

The code:

<a href="javascript:alert('Hello from Fillvisa!')" style="...">
  ✈️ Fillvisa Bookmarklet
</a>

Imagine a simple workflow:

You open a government application, click a bookmarklet, and the relevant fields are populated using information you've already prepared. No dedicated extension to install. No separate browser-store release. Just a small piece of JavaScript executed when the user needs it.

Why bookmarklets make sense for this use case

For Fillvisa, there are several advantages.

They're lightweight. We don't need a full browser extension architecture to perform a relatively focused task.

They're relatively browser-independent. A bookmarklet uses standard browser JavaScript instead of depending on browser-specific extension APIs. Browser compatibility testing is still necessary, but there's less extension-specific infrastructure to maintain.

They're user-initiated. The user opens the official government website, signs in or starts an application, and chooses when to run the script.

They're easier to distribute. For supported browsers, users can add a bookmarklet directly to their bookmarks bar without installing a browser extension.

There are limitations, of course.

A bookmarklet can break when the government website changes its HTML structure, field identifiers, or JavaScript behavior. Content Security Policy restrictions can also affect whether certain bookmarklets execute. So bookmarklets aren't universally better than extensions. But for a focused, user-initiated autofill workflow, they can be a much simpler engineering solution.

How we're using bookmarklets in Fillvisa

Here's how the process works with our DS-160 form.

Step 1: Capture the information using a modern web form

Instead of asking users to enter information directly into CEAC, we provide a simpler form through Fillvisa. Users enter their personal details, passport information, travel history, employment details, and other required answers.

With Fillvisa Free, everything is saved locally in the browser.

There's no account required, no cloud database, and no government session ticking away while you're preparing the application. You can complete the form at your own pace.

Step 2: Transform the data into a bookmarklet

Once the information is ready, we use JavaScript to prepare the data for transfer. This is where the interesting engineering work happens. Our form might store information using a straightforward internal field name, such as:

applicant.lastName

But the government website may identify the same information using a completely different field name or HTML element. We maintain a mapping between our form's data and the fields expected by the government portal. The script handles the translation, prepares the values in the expected format, and generates the bookmarklet used for autofill.

Step 3: Populate the official government form

The user opens the official CEAC website and starts or retrieves their DS-160 application. After completing the required security checks, they activate the Fillvisa bookmarklet. The script runs inside the existing webpage and populates the corresponding fields using the prepared data.

This isn't always as simple as assigning values to HTML inputs. Some government applications use conditional questions, dynamic elements, and server-side postbacks.

For example, selecting Yes to a question may trigger a server request before additional fields become available. Our autofill logic needs to account for those interactions, wait for the relevant fields to appear, and populate them in the correct sequence. That's the real engineering challenge: mapping modern, structured form data into an older, stateful web application.

Step 4: Review and submit

The bookmarklet doesn't submit the visa application. The user remains on the official government website, reviews the populated information, completes any outstanding questions, and submits the application themselves. We also don't use the bookmarklet to bypass CAPTCHA, authentication, or government security checks. The goal is to eliminate repetitive data entry, not take control of the application process. And importantly, the bookmarklet doesn't prevent CEAC's session timeout. Instead, it reduces the amount of time users need to spend manually entering information inside that session.

Beyond DS-160: Schengen visas and USCIS e-filing

We've already implemented this approach for DS-160, but I think the underlying idea has applications beyond one government portal.

Schengen visa applications

The Schengen Area includes multiple countries, each with its own visa application processes and technology. For example, France-Visas allows applicants to prepare visa applications online.

Other Schengen countries use different online portals or application workflows. This presents an interesting opportunity.

Instead of building an entirely separate data-entry experience for every country, we could collect information through a standardized web form and develop country-specific scripts that populate the corresponding government portals. Of course, this would require individual integrations and testing. There's no single bookmarklet that automatically works across every Schengen country.

USCIS online filing

Another area I'm interested in is USCIS e-filing. Today, Fillvisa can generate completed official PDFs for supported USCIS forms. But USCIS also supports online filing for certain applications. For example, applicants can prepare eligible forms through their USCIS online accounts. I'm exploring how we could extend our bookmarklet approach to those online workflows.

Imagine an immigration professional collecting a client's information once through Fillvisa, reusing it across multiple forms, and then transferring the relevant answers into a supported USCIS online application. The implementation would need to account for USCIS's dynamic forms, authentication requirements, and portal restrictions. It's an area we're exploring rather than a feature we've released. But the broader opportunity is clear.

Collect information once. Reuse it wherever it's needed.

Sometimes, simpler engineering wins

As developers, we often gravitate toward sophisticated solutions.

Browser extensions. APIs. Headless browsers. Backend automation. Complex integrations. Sometimes, those solutions are necessary. But not every problem needs an elaborate architecture.

For Fillvisa, the objective was simple: help users transfer information they've already entered into an official government form without retyping everything.

A bookmarklet turned out to be a practical solution.

It's lightweight, relatively easy to distribute, and works within the user's existing browser session on supported government pages. It still requires maintenance, and it isn't appropriate for every website.

But it's a good reminder that the best engineering solution isn't always the newest technology. Sometimes, it's the simplest one that solves the problem.

Try Fillvisa: Free, Open Source, and Plus

We're building Fillvisa to make immigration forms easier and more accessible, both for individual applicants and immigration professionals.

Fillvisa Free — A free, browser-based immigration form filler. Complete supported USCIS forms, generate official PDFs, and use our DS-160 bookmarklet to autofill the CEAC website. No account required.

Fillvisa Open Source — The open-source version of Fillvisa, licensed under AGPL-3.0. Developers, nonprofits, and civic technologists can self-host, study, fork, and customize the application under the license terms.

Fillvisa Plus — Built for immigration document preparers, paralegals, and solo immigration attorneys. Includes cloud storage, client collaboration, client intake, and the ability to reuse client information across supported forms.

Whether you're preparing your own visa application or managing immigration paperwork for clients, our goal is the same:

Less time wrestling with government forms. More time getting things done.