Does HybridWebView support external web content to invoke C# from JavaScript? #30086
Unanswered
jameslin0312
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am using .NET 9 MAUI HybridWebView to invoke C# from JavaScript by "window.HybridWebView.InvokeDotNet". It works fine if I only have local html and JavaScript. But if I change the window.location to external URL and invoke C# from remote JavaScript by including HybridWebView.js and change the fetching URL as
https://0.0.0.1/__hwvInvokeDotNet?data=${encodeURIComponent(message)}
, the request will be blocked by cross domain policy. Is it possible to load remote web content and invoke C# from JavaScript?Beta Was this translation helpful? Give feedback.
All reactions