None of the above answers worked for me out of the box.
elinks
though is the only one pretty much capable this is what I did:
sudo apt install libmozjs185-dev pkg-config libssl-dev
Very important to have installed pkg-config
, without it configure cannot detect SpiderMonkey Javascript engine, without libssl-dev
you cannot access HTTPS sites.
wget http://elinks.or.cz/download/elinks-current-0.13.tar.bz2
unpack:
tar xvf elinks-current-0.13.tar.bz2
cd elinks-0.13-20171228/
then configure and check if javascript is seen:
./configure | grep -i "javascript"
Result should be:
ECMAScript (JavaScript) ......... SpiderMonkey document scripting
if result is
ECMAScript (JavaScript) ......... no
check the steps above until the right result is give.
Then make the sources
make -j8
And install it:
sudo make install
Now enable and try it, by running:
elinks ./test/ecmascript/protocol.html
Press Alt+S, O
Key down (↓) and then Space on ECMAScript
, Alt+E on Enable
change to 1

Alt+V to save and then OK
Now it's able to execute some Javascript.