6
$\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$
  • 4
    $\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 '17 at 0:21
6
$\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$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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