在Linux CLI中解释并执行任意Javascript [英] Interpret and execute arbitrary Javascript in Linux CLI

查看:77
本文介绍了在Linux CLI中解释并执行任意Javascript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找方法来做一段时间,但还没有找到正确的方法。

I've been looking for ways to do this for a while but haven't quite been able to find the right way to do it.

任务:从Linux命令行执行Javascript。

The task: Execute Javascript from a Linux command line.

例如,有二进制或其他任何将解释Javascript加载一些.js文件,然后打印一些变量值。

For example, have the binary or whatever is going to interpret Javascript load up some .js files, then print a value of some variable.

更具体的例子:我想得到最终版本的Javascript被解释并执行后的这个页面 http://www.vureel.com/video / 2809 /美式爸爸的。如果您使用Firebug查看该页面,您将看到这个模糊的Javascript

More concrete example: I would like to get the final version of this page after Javascript has been interpreted and executed http://www.vureel.com/video/2809/American-Dad. If you look at the page with Firebug, you will see that this obscure Javascript

< script language =JavaScripttype =text / javascript> / *<![CDATA [* / var a,s,n; function a8bcb4f34dfd6e81cfdb9c115d1671582(s){r =; for(i = 0; i< s.length; i ++){n = s .charCodeAt(i); if(n< 128){n = n ... etc ...< / script>

变成了一个很好的嵌入代码

turned into a nice embed code

< embed height =390width =642flashvars =file = http:// vureel -cdn-2.vureel.com/leechingisillegal/537c69afbcaf4c7cf416f30077bbe9d1/4a29621d/here/2809.flv ... etc ... />

这只是一个例子,但希望你看到我正在开车的地方。

This is just an example but hopefully you see what I'm driving at.

推荐答案

看看 Rhino 引擎(维基百科上的犀牛

以下是一些替代方案:

  • Mozilla SpiderMonkey
  • JSDB
  • wxJavaScript

您可能还想看看 Node.js

这篇关于在Linux CLI中解释并执行任意Javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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