如何在Android中运行CasperJS文件? [英] How can I run CasperJS files in Android?

查看:86
本文介绍了如何在Android中运行CasperJS文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Android中安装和运行CasperJS文件?

How can I install and run CasperJS files in Android? Is it possible?

我想创建一个相等的应用程序 droidscript 具有测试功能并在Web视图上执行。

I would like to create an equal application droidscript with test functions and execute on a webview.

推荐答案

CasperJS是基于PhantomJS(和SlimerJS)构建的。这些是浏览器本身。它们不能在WebView中运行。也许可以编译,尽管我没有找到任何记录的试验。

CasperJS is built on top of PhantomJS (and SlimerJS). Those are browsers themselves. They cannot be run in a WebView. It may be possible to compile, though I didn't find any documented trials.

您应该能够移植 PhantomJS API 转换为Android WebView,然后对 CasperJS ,以便它使用此新API并可以通过DroidScript运行。这是一个任务。

You should be able to port the PhantomJS API to an Android WebView and then make some adjustments to CasperJS so that it uses this new API and can be run through DroidScript. This is a big task.

更简单的任务是保留 PhantomJS / CasperJS实例(或从您要使用的服务器端框架中生成实例),并使用应用程序中的特定脚本对其进行查询。您可以将制作的所有屏幕截图发送到该应用,但无法进行实时视频观看。

An easier task would be to keep a PhantomJS/CasperJS instance running on a server (or spawn an instance from the server-side framework you would like to use) and query it with the specific scripts from your app. You can send all screenshots that are made to the app, but a live video view will not be possible.

这篇关于如何在Android中运行CasperJS文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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