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] Add tauri://pageLoad event listener support in frontend #11995

Open
KazeLiu opened this issue Dec 18, 2024 · 0 comments
Open

[feat] Add tauri://pageLoad event listener support in frontend #11995

KazeLiu opened this issue Dec 18, 2024 · 0 comments

Comments

@KazeLiu
Copy link

KazeLiu commented Dec 18, 2024

Describe the problem

When creating a new window using WebviewWindow, I can only use tauri://created to listen for window creation. However, this event triggers much earlier than the actual page load completion.

Currently, if I need to inject JavaScript after the page is fully loaded, I have to:

  1. Use WebviewWindowBuilder::new(&app_handle, &label, url_parse).on_page_load in the backend
  2. Emit an event to notify the frontend

The challenge is that I'm not familiar with backend development in Rust, and I have to rely on my friend to help implement these backend methods.

Technical Context:

  • Current approach requires backend implementation
  • Frontend developers need a more accessible way to handle post-load operations
  • Similar to how browsers provide window.onload event

thanks

Describe the solution you'd like

  1. Add a frontend event listener for page load completion (similar to tauri://pageLoad)
  2. Add frontend API for JavaScript injection

This would greatly improve the developer experience for frontend developers who are not yet proficient in Rust but need these functionalities for their projects.

Alternatives considered

No response

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant