Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows custom ui extension workaround #4

Closed
HuakunShen opened this issue Nov 3, 2024 · 0 comments · Fixed by #24
Closed

Windows custom ui extension workaround #4

HuakunShen opened this issue Nov 3, 2024 · 0 comments · Fixed by #24
Labels
bug Something isn't working
Milestone

Comments

@HuakunShen
Copy link
Contributor

HuakunShen commented Nov 3, 2024

From

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

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).

Disable multi-window support for extensions, i.e. only one extension at a time; extension only loads in main window
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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant