摘要
在嵌入式浏览器中,很多应用场景都需要进行JavaScript扩展,JavaScript代码和本地组件之间的异步调用是一个难点。针对这种情况,基于业界普遍采用的Web Kit内核浏览器,提出一种扩展JavaScript对象的方法。首先研究WebKit中WebCore和JavaScript引擎的绑定机制,然后提出扩展JavaScript对象和自定义JavaScript事件的方法,并给出相应实验结果。实验结果表明该扩展方法的有效性,特别适于解决JavaScript和本地组件的异步调用问题。
JavaScript extension is needed in many application scenarios in embedded browsers, and asynchronous invocation between JavaScript code and native module is a problem. In view of this, we proposed a method of extending JavaScript object based on the browser with WebKit core widely used in the industry. First, we studied the binding mechanism between WebCore and JavaScript engine in WebKit. Then we raised the methods of extending JavaScript object and customising JavaScript event, and presented the corresponding experimental result. Experimental result showed the validity of the JavaScript extension method, it was especially suitable for asynchronous invocation between JavaSeript and native module.
出处
《计算机应用与软件》
CSCD
2016年第1期226-229,共4页
Computer Applications and Software
基金
国家科技支撑计划课题(2012BAH73F01
2012BAH02B01)