Skip to content

Conversation

EC-Sol
Copy link

@EC-Sol EC-Sol commented Aug 13, 2025

Summary

Add Electron support for offline desktop application

This PR enables Squoosh to run as a standalone Windows desktop application that works completely offline, making it suitable for
use in restricted network environments.

Changes

  • Add Electron configuration (electron.js): Creates a desktop app wrapper with embedded Express server
  • Update package.json: Add Electron dependencies and build scripts for Windows executable
  • Local HTTP server: Uses Express to serve the web app locally, avoiding file protocol issues
  • Offline-first: No external network dependencies - all resources served from local files

Key Features

  • Fully functional offline image conversion
  • Builds to standalone Windows executable (.exe)

Technical Approach

  1. Embeds an Express server inside Electron
  2. Serves the original build files via http://localhost:[random-port]
  3. Preserves all original web app functionality without modifications

Usage

# Development
npm run start:electron

# Build Windows executable
npm run dist

Copy link

google-cla bot commented Aug 13, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant