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

[feat] Improved native navigation API #4080

Closed
jhutchins opened this issue May 8, 2022 · 0 comments
Closed

[feat] Improved native navigation API #4080

jhutchins opened this issue May 8, 2022 · 0 comments

Comments

@jhutchins
Copy link
Contributor

Currently the ability to access and control navigation on a Window from the native rust code is extremely limited. The best you can hope for is evaluating JavaScript to change the URL. Since the native WebView APIs provide information regarding current URL with the ability to change it would make nice to expose some form of this from the Window structure.

Ideally there would be hooks to get the current window URL, navigate to a new URL and the ability to register listeners for changes in URL. WRY already provides a mechanism for attaching a navigation controller that's called every time the view URL changes. This could easily be used to provide navigation events as well as the ability to limit navigation to external URLs. Likewise, the native WebView structures allow retrieving and changing the URL, it's just a matter of creating a unified interface for accessing and manipulating that information and then plumbing it through the many abstraction layers.

@jhutchins jhutchins changed the title [feat] Improved native navigation api [feat] Improved native navigation API May 8, 2022
luoffei pushed a commit to luoffei/tauri that referenced this issue Dec 29, 2022
tauri-apps#5686)

Co-authored-by: silvanshade <silvanshade@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant