-
Notifications
You must be signed in to change notification settings - Fork 104
add JavaScriptCoreSharp #274
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
base: develop
Are you sure you want to change the base?
Conversation
I've taken this branch and lytico:lytico/webkit2 and merged them into one branch (jwosty:jwosty/frankenbranch) to see how they are working together - it builds. I'm trying to get script message handlers to work, but getting this runtime error:
What does this mean? I'd love to try to fix this, but I don't have experience working with GLib->.NET bindings. Here's the code that registers the handler (it's F#): webView.Settings.EnableDeveloperExtras <- true
webView.Settings.EnableWriteConsoleMessagesToStdout <- true
webView.UserContentManager.ScriptMessageReceived.Add (fun e ->
printfn "%A" e
()
)
if not (webView.UserContentManager.RegisterScriptMessageHandler("interstellarBridge")) then
eprintfn "Failed to register script message handler; JS bridge will not work" And the JS I used to trigger the handler (just execute via the JS console in the inspector in the app):
Any pointers on what needs fixing? |
FWIW, this is my use case:
Your two PRs seem to enable most of this to work (great job so for); the script message handler seems to be the last thing holding it back. Do these parts already work in the mono library? I'd be happy to use that for now, but I'd want to switch back to this fork ASAP, since .NET Core compatibility is a huge plus. |
seems to be a problem with namespaces in WebkitGtkSharp-api.xml missing type is generated in in WebkitGtkSharp-api.xml it's typed as WebKitJavascriptResult and it's never registered with GLib.GType.Register (...) |
Happy to see you looking into this again. BlazorWebView for GTK would be so great! |
the problem seems to be in JavaScriptCore.Result test is Samples.WebviewSection generated Code in JavascriptResult (slightly changed for debugging):
then, in it crashes calling g_object_is_floating(o)
|
No description provided.