Windows protocol switching

August 15, 2026 ยท View on GitHub

The packaged iPolloWork app owns the ipollowork:// protocol used to return a browser sign-in grant to the desktop. Electron development builds intentionally do not register that production protocol automatically. As a result, Windows development against iPolloCloud may remain on Connecting to iPolloWork... after Cloud has created the handoff grant.

This repository includes two Windows helpers for local development:

  • scripts/windows/use-development-protocol.cmd points ipollowork:// at this source checkout.
  • scripts/windows/restore-production-protocol.cmd points it back at an installed production app.

They modify only the current user's HKCU\Software\Classes\ipollowork registry key and do not require administrator permission.

Switch to the development app

Install dependencies and start the isolated Cloud development profile:

.\ipollowork.cmd setup
.\ipollowork.cmd dev:cloud http://localhost:3100

Then double-click scripts/windows/use-development-protocol.cmd, or run:

.\scripts\windows\use-development-protocol.cmd

After registration or sign-in in the system browser, approve the browser prompt to open iPolloWork. The helper recreates the dev:cloud environment and forwards the one-time callback URL to the already-running isolated Electron profile.

The registered command follows the location of this checkout. Run the switch script again after moving or renaming the repository.

Restore the production app

When development testing is complete, double-click scripts/windows/restore-production-protocol.cmd, or run:

.\scripts\windows\restore-production-protocol.cmd

The helper searches standard per-user and Program Files locations plus Windows uninstall metadata. It validates the production executable before changing the registry. If no installed production app is found, it exits with an error and leaves the current protocol handler unchanged.

Installing or launching a packaged iPolloWork release may also register the production handler again.

Safety and limitations

  • Only one application can own ipollowork:// for the current Windows user.
  • Switching to development temporarily redirects production browser callbacks to the development checkout.
  • Restore the production handler before testing the packaged application.
  • The scripts do not start iPolloCloud and do not initialize its database.
  • This is a local workaround for external-browser development authentication; a dedicated development protocol remains the preferred long-term solution.

Verification

The regression test uses a temporary registry key and never changes the live protocol handler:

node --test scripts/windows-protocol-switcher.test.mjs

It covers development registration, production restoration, and the safe failure path when no production installation exists.