refactor(core)!: pass webview label to uri scheme protocol handlers#11163
refactor(core)!: pass webview label to uri scheme protocol handlers#11163lucasfernog merged 5 commits intodevfrom
Conversation
Package Changes Through d85f06aThere are 1 changes which include tauri with prerelease Planned Package VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
crates/tauri/src/app.rs
Outdated
| N: Into<String>, | ||
| T: Into<Cow<'static, [u8]>>, | ||
| H: Fn(&AppHandle<R>, http::Request<Vec<u8>>) -> http::Response<T> + Send + Sync + 'static, | ||
| H: Fn(&AppHandle<R>, http::Request<Vec<u8>>, &str) -> http::Response<T> + Send + Sync + 'static, |
There was a problem hiding this comment.
to make this more flexible, I'd change the signature to maybe contain a single struct SchemeRequest { request: http::Request, app: AppHandle<R>, webview_label: String }
otherwise we need to break the API again when we want to add any other information
There was a problem hiding this comment.
I don't think the request should be hidden inside a struct and be kept as an argument so instead I did this Fn(UriSchemeContext<'_, R>, http::Request<Vec<u8>>) -> http::Response<T>
close #10691