According to doc, `world_name` in `register_script_message_handler` and `register_script_message_handler_with_reply` is nullable but the VAPI is not. If world_name is not set to null, we cannot use this messaging merchanism in common browser script.
I see the world_name parameter of webkit_user_content_manager_register_script_message_handler_with_reply() is not properly annotated as nullable. We can fix that. I don't see anything wrong with register_script_message_handler() though.
Pull request: https://github.com/WebKit/WebKit/pull/24417
Thanks for the fix. Maybe I use an old version of the lib(from fedora repo). I saw the wrong parameter defined for both functions.
If you're getting it from Fedora, then it's not old. I maintain the Fedora package. If you can point to evidence showing what is wrong, that would be great. It would be better to look at the gir file than the vapi file, though, because we don't distribute a vapi. That is provided by vala, not by us. Although unlikely, it's possible that a bug could have been introduced at that level.
Looks like the vapi was fixed in https://gitlab.gnome.org/GNOME/vala/-/commit/c5dfcd3065116b94d12ddda54f8feefb944ca51a and Fedora has that change already. Maybe your vala package is old?
Anyway, you can work around this by declaring the function in your own vapi for now. Note that the WebKit change here only directly fixes languages that use introspection directly. It won't directly affect vala until the next time vala updates its WebKitGTK bindings. That doesn't usually take very long, but it means the eventual fix will arrive in a vala update, not a WebKit update. Just something to be aware of.
Committed 274653@main (5d528e1cafca): <https://commits.webkit.org/274653@main> Reviewed commits have been landed. Closing PR #24417 and removing active labels.
Thanks. I am new to Vala and don't know much details. I'll check it later after vala update.