-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Let WebView receive messages from the WebSite #14325
Comments
Hi, check out the HybridWebView prototype I wrote a while ago. I think it handles the exact scenario that you are looking for.
|
Also, even if it isn't exactly what you need, if you do check it out, I'd love to hear your feedback. And also it might have sample code that could be useful to you in the meantime if you need to build something custom. |
Hello, @Eilon I think it should be very suitable for me. I've seen this project at Leuan Walker, but I didn't know it was yours. I think his simplified version is also very informative. So...When can I use it? Or is it suitable for me to add it to my project now? Can this represent the official development direction of MAUI? Or is it a try? Thank you for your time. You have saved me time more than once. thank you very much. |
Hi @SF-Simon , the HybridWebView that I showed is currently only an experiment, but it's something we're considering adding to the product in the future. As such, you can certainly use it right now, but it is not officially supported, and has not been extensively tested. One way to look at it is that if you need some functionality like what it provides, it should serve as an example of how you can make progress in your app until there is an official solution for it. |
Duplicate of #6446 |
Closing this one as the other one is much more active. See you all on that one! |
Description
This is a very important interaction requirement, so that we can execute some scripts from the web and notify C# to execute certain processes. We can also receive data from the Web and store it in the current database.
Public API Changes
Should just send a command name and an object like WKWebView?
The actual running code should still be completed by C# itself, which is the safest.
Just inject a JS script to implement the command function before the webpage initialization is completed.
https://developer.apple.com/documentation/webkit/wkscriptmessagehandler
Intended Use-Case
For example, send some events from the WebEditor to the MAUI client, and then the MAUI client responds to the events.
The text was updated successfully, but these errors were encountered: