-
Notifications
You must be signed in to change notification settings - Fork 78
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
Can I intercept navigation events? #139
Comments
We do not currently handle those kind of events (yet). These events would need to be added to the list of events we already do handle, which someone with time and interest could probably accomplish. It is not going to be on our immediate TODO list though. |
You can do this, but not using the built in c#/js interop. You need to build a proper webapi and then self host it in the Photino app. But that's cool, because you can then use all the webapi packages for OAuth. You don't have to self host it though, you would just be keeping state in w/e is hosting the api. |
If you want to handle the navigation events on the client, that can be done in JavaScript. It's built into many SPA frameworks. Or in pure JavaScript, take a look at https://developer.mozilla.org/en-US/docs/Web/API/Navigation/navigate_event#examples. If you want to handle it on the back end, then @rtmann is correct, you can handle it in the web server. ASP.NET for example, which is small, fast and already included in the deployment. the only place you can't handle it right now is in the WebView control where it raises an event sent back to your .NET app. We may be able to add that at some point. |
Yeah, I guess my point was that if you use the web api on the back end, you don't need to handle any navigation events. The packages, configured properly, will just work. |
I am trying to see if I can use this library to implement OAUTH in my dotnet application. In order to accomplish this, I need to be able to intercept the redirect responses from the server, because I need to compare them against the OAUTH callback value.
Is there a way to register for events for when the url changes in the browser? Basically the "Navigation Starting" event from WebView2 (https://learn.microsoft.com/en-us/microsoft-edge/webview2/concepts/navigation-events)
I did notice a WebMessageReceivedHandler available, but (at least on windows) I can't get it to fire to understand what it does.
(EDIT: I now understand this event appears to fire only when something clicked, so it won't help me).
The text was updated successfully, but these errors were encountered: