Expose wry navigation_handler via WindowBuilder closes #4080#5686
Merged
lucasfernog merged 5 commits intotauri-apps:devfrom Dec 27, 2022
Merged
Expose wry navigation_handler via WindowBuilder closes #4080#5686lucasfernog merged 5 commits intotauri-apps:devfrom
lucasfernog merged 5 commits intotauri-apps:devfrom
Conversation
Contributor
Author
|
Fixes #5411. |
d98e9bf to
8685edd
Compare
8685edd to
af055e3
Compare
luoffei
pushed a commit
to luoffei/tauri
that referenced
this pull request
Dec 29, 2022
tauri-apps#5686) Co-authored-by: silvanshade <silvanshade@users.noreply.github.com> Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
Does this PR introduce a breaking change?
Checklist
fix: remove a typo, closes #___, #___)Other information
Rationale
Currently, it is difficult to use
taurifor certain situations, for example, those involving OAuth redirects. This has been noted in issues #3020, #5411, and elsewhere.In some cases it is possible to find workarounds, such as by launching a local
warpserver and handlinglocalhostredirects that way, but this is not always possible, particularly when the service in question uses deep linking and app-specific custom URI schemes.A simple way to address this problem is to allow handling of URL navigation events with a callback configured for the webview. This is already possible now with
wryusingWebViewBuilder::with_navigation_handler. However, as far as I could tell, there was no way to access this functionality fromwrydirectly throughtauriprior to this PR.This PR resolves that problem by allowing the user to set a navigation handler with
tauri::WindowBuilderwhich then gets passed on towrywhen the window is created via the runtime.