桌面的WebKit相当于Android的addJavascriptInterface的()? [英] desktop webkit equivalent of Android's addJavascriptInterface()?

查看:160
本文介绍了桌面的WebKit相当于Android的addJavascriptInterface的()?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

虽然研究的Andr​​oid UI的可能性,我在整个文档来到一个名为addJavascriptInterface()方法,可以让你暴露在UI的部分的WebView一个Android Java对象的JavaScript的方法。

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.

这个想法似乎非常有用和明显(在概念上,没有实施方面)。不过,我似乎无法找到WebKit引擎的桌面版的等价物。有些事情有像pywebkitgtk和Qt的版本网页视图,允许本机应用程序和Web应用程序之间的一些有限的交流,但他们似乎都需要时髦的黑客和自主开发的消息层。 Android的办法是更优雅。

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.

是否有人知道的类似简单的方法可以去弥合本地桌面code HTML5的应用程序?

Does anybody know of a similarly simple way one might go about bridging a HTML5 application with native desktop code?

推荐答案

在寻找类似的功能,我碰到几个选项就来了:

While looking for similar functionality, I came across several options:

  • Appcelerator's Titanium Desktop
  • Use Google's Web Toolkit for desktop app development, see this SO question.
  • Adobe Air
  • HTML5 for desktop app development - Another SO question which has several similar answers.

这似乎是几个不同的社区云集的这种类型的功能,进一步模糊桌面和网络之间的界限。

It seems like several different communities are converging on this type of functionality, further blurring the line between the desktop and the web.

这篇关于桌面的WebKit相当于Android的addJavascriptInterface的()?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆