9
$\begingroup$

One way of running Javascript on a website is to use for instance Greasemonkey. By any chance, would it be possible to execute Javascript commands from Mathematica?

$\endgroup$
1
  • 5
    $\begingroup$ See WebUnit. Also, if you want to evaluate JavaScript in general – not on a website – I'm guessing that ExternalEvaluate could be used together with NodeJS. $\endgroup$
    – C. E.
    Sep 23, 2017 at 0:21

2 Answers 2

9
$\begingroup$

This is now possible in Mathematica 12.

For example , you can open a new tab in web browser using following code:

session = StartWebSession[]

WebExecute["OpenPage" -> "https://www.wolfram.com"]

WebExecute["JavascriptExecute" -> "window.open('https://www.wolframalpha.com', '_blank')"]

For additional information , visit : https://reference.wolfram.com/language/ref/WebExecute.html

$\endgroup$
1
$\begingroup$

It might be relevant, you can run both in the browser https://github.com/JerryI/wljs-interpreter

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.