Hi, thank you for this helpful plugin!
I'm using desktop_webview_window in my Flutter Linux app to embed a webview. The addOnUrlRequestCallback works fine for traditional full-page navigations, but it's not triggered when navigating within a Single Page Application (SPA) such as a React app that uses client-side routing (e.g. React Router or Next.js).
Steps to Reproduce:
- Load a React-based SPA (e.g. a local or deployed React app) in the webview.
- Use the app's navigation (e.g. Use navigate or clicking on a element to route to another page).
- Observe that addOnUrlRequestCallback is not called on these URL changes.
Expected Behavior:
- The callback should also be triggered when the URL changes due to client-side routing in SPAs, not just for full-page navigations.
- Alternatively, we could have a new dedicated callback specifically for detecting URL changes in SPA apps.
Actual Behavior:
addOnUrlRequestCallback is only triggered for full page loads (e.g. window.location.href = '...') and not for history API-based routing (history.pushState, replaceState), which is commonly used in SPAs.
Environment:
OS: Linux
Flutter version: 3.29.2
Plugin version: ^0.2.3