Closed liesauer closed 4 weeks ago
I think it is possible that this information is not supplied by the APIs Tauri uses. You might need to register a scheme for each behaviour you want, or include a parameter in the URI (e.g. ?referrer=...
) which allows you to differentiate the source in your handler. (And if that's possible, I suppose Tauri could build an abstraction around that, technically.)
I think it is possible that this information is not supplied by the APIs Tauri uses. You might need to register a scheme for each behaviour you want, or include a parameter in the URI (e.g.
?referrer=...
) which allows you to differentiate the source in your handler. (And if that's possible, I suppose Tauri could build an abstraction around that, technically.)
it's impossible to register 100 scheme protocols if i have 100 apps, all i need is one app://
scheme and loading different content from $DATA_DIR/$APP_ID
, url query is kind of solution, but what if the user change app://main.html?app=a
to app://main.html?app=b
?
i am not expecting expose the APP_ID to the frontend, all the logic should be rust-side.
when launching an "app", the window label is forced to be APP_ID and won't be changed, it's the most safe way to identify an "app", the user never and also no need to know there is a APP_ID thing exists.
Describe the problem
when a custom uri scheme protocol is called, there is no way to know the request is send by which window and webview, so cannot do special logic between different windows and webviews.
Describe the solution you'd like
makes the protocol handler(
) become something like this:Fn(app, request) -> Response
Fn(app, window, webview, request) -> Response
or
Fn(app, window_label, webview_label, request) -> Response
for both
register_uri_scheme_protocol
andregister_asynchronous_uri_scheme_protocol
Alternatives considered
No response
Additional context
No response