Skip to content
This repository has been archived by the owner on Nov 7, 2024. It is now read-only.

Windows custom protocol workaround: multi-server extension loading #81

Open
HuakunShen opened this issue Oct 28, 2024 · 0 comments · May be fixed by #84
Open

Windows custom protocol workaround: multi-server extension loading #81

HuakunShen opened this issue Oct 28, 2024 · 0 comments · May be fixed by #84

Comments

@HuakunShen
Copy link
Member

HuakunShen commented Oct 28, 2024

From

Tauri's implementation for custom protocol on Windows has a problem that denies requests from within iframe.

It doesn't seem like there will be a fix from Tauri, so I have to implement a workaround for windows.

Candidate Solutions

Since custom protocol won't work, the only option is to serve files from http file server.
But I don't really want to revert to the old design where each extension need base url configuration (so ugly and hard to maintain).

  1. Disable multi-window support for extensions, i.e. only one extension at a time; extension only loads in main window
  2. Still support multi-window, then spawn a new file server per custom ui extension, and kill it after window is closed
    • Make use of the window extension hash map stored in app state. Maybe simply also store an axum server handle in the hash map
    • Existing code will remove a window label from the map when extension quits, just kill the server with server handle here

For now I'd choose option 2 (multi server)

There could be multiple servers simultaneously, which takes more ports, and more RAM.
However, since all servers on in a single process, but different thread, and the workload isn't heavy (just serve static files), I guess the extra RAM usage won't be too much (experiment required)

@HuakunShen HuakunShen added this to the v0.2 First Stable Release milestone Oct 28, 2024
@HuakunShen HuakunShen linked a pull request Oct 28, 2024 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant