api-client/packages/hoppscotch-desktop
Shreyas 93787f8389
fix(desktop): add win version checks for DWM attr api (#5010)
fix: add win version checks for DWM attr api

This adds version checking before using Windows 11-specific DWM APIs.

Closes HFE-821

The desktop app crashes on startup on older Windows versions (pre-Windows 11)
due to unsupported DWM API calls for dark mode and caption styling.

According to docs at https://learn.microsoft.com/en-us/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute,
both `DWMWA_USE_IMMERSIVE_DARK_MODE` and `DWMWA_CAPTION_COLOR` attributes
are only supported starting with Windows 11 Build 22000.

> DWMWA_USE_IMMERSIVE_DARK_MODE: [...] This value is supported starting
> with Windows 11 Build 22000"

and

> DWMWA_CAPTION_COLOR: [...] This value is supported starting
> with Windows 11 Build 22000.

See https://github.com/hoppscotch/hoppscotch/discussions/4984 for more details,
for reports of app crashing immediately on startup with these errors:

```
Failed to set dark mode: Error { code: HRESULT(0x80070057), message: "The parameter is incorrect." }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[0417/150158.530:ERROR:window_impl.cc(122)] Failed to unregister class Chrome_WidgetWin_0. Error = 1412
```

The tests were all over the place, both attributes (sometimes!) seems to be present
on Windows 10 1809 and even earlier, only if it was installed with network access,
so perhaps this is due to Windows updates? Other times, they weren't, especially on VMs.

The issue is reproducible on Windows Server 2019 Datacenter (v10.0.17763),
which is equivalent to Windows 10 version 1809.

This version is too old to support DWMWA_USE_IMMERSIVE_DARK_MODE,
which is only **officially supported** starting with Windows 11 Build 22000
according to Microsoft's documentation.

So at the moment, relying on official docs seems to be the right call,
and themes are definitely something app shouldn't crash for regardless.
2025-04-25 16:48:43 +05:30
..
crates/webapp-bundler feat: platform independent core and the new desktop app (#4684) 2025-02-28 00:01:25 +05:30
plugin-workspace fix(desktop): add win version checks for DWM attr api (#5010) 2025-04-25 16:48:43 +05:30
public feat: platform independent core and the new desktop app (#4684) 2025-02-28 00:01:25 +05:30
src fix: resolve typos across packages (#4867) 2025-03-12 13:53:08 +05:30
src-tauri fix(desktop): add win version checks for DWM attr api (#5010) 2025-04-25 16:48:43 +05:30
.gitignore feat: platform independent core and the new desktop app (#4684) 2025-02-28 00:01:25 +05:30
connection-to-self-hosted-instance.png docs(desktop): update README (#4864) 2025-03-10 22:46:15 +05:30
desktop-app.png docs(desktop): update README (#4864) 2025-03-10 22:46:15 +05:30
index.html feat: platform independent core and the new desktop app (#4684) 2025-02-28 00:01:25 +05:30
package.json chore: bump version to 2025.3.2 2025-04-15 13:16:56 +05:30
postcss.config.js feat: platform independent core and the new desktop app (#4684) 2025-02-28 00:01:25 +05:30
README.md docs(desktop): include windows specific caveats (#4884) 2025-03-13 16:25:25 +05:30
tailwind.config.ts feat: platform independent core and the new desktop app (#4684) 2025-02-28 00:01:25 +05:30
tsconfig.json feat: platform independent core and the new desktop app (#4684) 2025-02-28 00:01:25 +05:30
tsconfig.node.json feat: platform independent core and the new desktop app (#4684) 2025-02-28 00:01:25 +05:30
vite.config.ts fix(desktop): cache size for larger bundles, dev server, lints (#4796) 2025-02-28 22:18:51 +05:30

Hoppscotch Desktop App ALPHA

Hoppscotch Desktop

Download | Official Docs


Hoppscotch Desktop App is a cross-platform Hoppscotch app built with Tauri V2

Hoppscotch Desktop App

Now with the ability to connect to Self-Hosted instances

Hoppscotch Desktop App

Install Hoppscotch Desktop App

  1. Download the latest version of Hoppscotch Desktop App
  2. Open the downloaded file.
  3. Follow the on-screen instructions to install Hoppscotch Desktop App.
  4. Open Hoppscotch Desktop App.

Access Hoppscotch

Hoppscotch Cloud Edition for Individuals

Access Hoppscotch Cloud Edition from Hoppscotch Desktop App:

  1. Open Hoppscotch Desktop App.
  2. Click the Hoppscotch logo in the top-left corner.
  3. Click "HOPPSCOTCH CLOUD".
  4. Sign in with your Hoppscotch Cloud account to access your workspaces and collections.

Hoppscotch Self-Hosted Edition for Community

Note

To enable desktop app support for your self-hosted Hoppscotch instance, make sure to update the WHITELISTED_ORIGINS environment variable in your .env file with your deployment URL.

e.g. to allow connection to https://hoppscotch.mydomain.com you need to add app://hoppscotch_mydomain_com (MacOS, Linux) and http://app.hoppscotch_mydomain_com (Windows) to the WHITELISTED_ORIGINS environment variable.

WHITELISTED_ORIGINS=...existing_origins,app://hoppscotch_mydomain_com,http://app.hoppscotch_mydomain_com

Add your self-hosted Hoppscotch Community Edition instance to Hoppscotch Desktop App:

  1. Open Hoppscotch Desktop App.
  2. Click the Hoppscotch logo in the top-left corner.
  3. Click "Add an instance".
  4. Enter the URL of your self-hosted Hoppscotch instance.
  5. Click "Connect".

Tip

You can also self-host Hoppscotch Desktop App.

  1. Install and generate the selfhost web app:
    cd ../hoppscotch-selfhost-web
    pnpm install
    pnpm generate
    
  2. Build the webapp bundler:
    cd crates/webapp-bundler
    cargo build --release
    
  3. Bundle the web app:
    cd target/release
    ./webapp-bundler --input [path-to-dist-directory] --output [path-to-hoppscotch-desktop]/bundle.zip --manifest [path-to-hoppscotch-desktop]/manifest.json
    
  4. Run the Tauri development server:
    cd src-tauri
    pnpm tauri dev
    
    or the following for production build:
    cd src-tauri
    pnpm tauri dev
    

Note

[path-to-dist-directory] should point to the dist directory created by the pnpm generate command in step 1.

Hoppscotch Self-Hosted Edition for Enterprise

Note

To enable desktop app support for your self-hosted Hoppscotch instance, make sure to update the WHITELISTED_ORIGINS environment variable in your .env file with your deployment URL.

e.g. to allow connection to https://hoppscotch.mydomain.com you need to add app://hoppscotch_mydomain_com (MacOS, Linux) and http://app.hoppscotch_mydomain_com (Windows) to the WHITELISTED_ORIGINS environment variable.

WHITELISTED_ORIGINS=...existing_origins,app://hoppscotch_mydomain_com,http://app.hoppscotch_mydomain_com

Add your self-hosted Hoppscotch Enterprise Edition instance to Hoppscotch Desktop App:

  1. Open Hoppscotch Desktop App.
  2. Click the Hoppscotch logo in the top-left corner.
  3. Click "Add an instance".
  4. Enter the URL of your self-hosted Hoppscotch instance.
  5. Click "Connect".

Note

For docker setup, the desktop app uses a server at port 3200, and it is part of the frontend container:

 docker run -p 3000:3000 -p 3200:3200 hoppscotch/hoppscotch-frontend

Once the container is live, you can enter [your-ip]:3200 or simply the base address of the instance if you are using subpath access.