XPCOM support in Android webkit browser?

僤鯓⒐⒋嵵緔 提交于 2019-12-11 04:18:32

问题


Does the Android WebKit supports the XPCOM framework or NPRuntime API`s as like Firefox? How to implement JavaScript in the Android WebKit plug-in?

Update: I am writing a media player plug-in for the Android WebKit browser and my plug-in needs to get the command from the web page through JavaScript (some actions like play/pause/stop/resize are issued as JavaScript commands from the browser). My plug-in is written in native C code. Are there any examples or sample plug-in available for JavaScript communication?


回答1:


WebKit doesn't support XPCOM, as WebKit is entirely separate from the Mozilla stack.

When you say you want to "implement Javascript", what do you mean?
The built-in Android browser already supports the execution of Javascript.




回答2:


The android browser supported NPAPI all the time, the mechanism changed in 2.1 though, now it looks for APKs with the intent filter "android.webkit.PLUGIN", so a plugin needs to be packaged separately.

Previously setting the plugin path on the WebView and compiling the plugin using the NDK did the trick.

Hope this helps, you will find a lot of info when googling for NPAPI and WebView or NPAPI and android.




回答3:


Android's WebKit doesn't support XPCOM, nor does it support NPAPI and npruntime. Not sure how you're planning to write a browser plugin, but it's not going to be possible with the Android SDK.



来源:https://stackoverflow.com/questions/2176928/xpcom-support-in-android-webkit-browser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!