Registering message handler in default world in WebKit-6.0

It’s seems that, in either GJS or Python, it’s not currently possible to register message handlers in the default world in WebKit-6.0, as it doesn’t accept null / None as the second argument.

const webView = new WebKit.WebView()
const manager = webView.get_user_content_manager()
manager.register_script_message_handler('test', null)
// Error: Argument world_name may not be null

I also tried passing '' as the world name, but that seems to result in the handler being registered in a different world.

I found the problem. Will fix it.

Will be fixed in 2.40.1. Sorry for the inconvenience.

1 Like

Um, there’s also this bug which will break the signal even if you do manage to register the handler, although many distros have manually applied that patch already.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.