While researching Android UI possibilities, I came across documentation for a method called addJavascriptInterface() that allows you to expose methods on an Android Java object to the Javascript in a WebView component of your UI.
This idea seems so useful and obvious (in terms of concept, not implementation). However, I cannot seem to find any equivalent for a desktop version of the webkit engine. There are things out there like pywebkitgtk and qt's version of a webview that allow some limited communication between the native app and the web app, but they all seem to require funky hacks and homegrown messaging layers. The Android way is much more elegant.
Does anybody know of a similarly simple way one might go about bridging a HTML5 application with native desktop code?