30

I am searching for a text browser running JavaScript. It should be compatible with Linux platform.

Other features:

  • run JavaScript (this is the most important)
  • minor CSS rendering (text colors, background colors, borders maybe)
  • support XHR (is supposed to do if it runs js)
  • run in command line (terminal)

Any recommendations?

I tried lynx and elinks (sudo apt-get install ...), both not supporting JS.

  • 2
    Call me crazy, but I think links supports javascript. – dotVezz Sep 23 '14 at 16:38
  • @dotVezz If you prove me that, I will give you 100 points. :smile: Add an answer with the instructions and I will review it. :-) – Ionică Bizău Sep 23 '14 at 16:54
  • 2
    I should have done some google-fu before I commented. Javascript support is not available by default. Both it and elinks have an --enable-javascript compile flag. By default, "JavaScript support was removed in release 2.1pre29 because it was buggy." So in other words... I probably wouldn't bother with links and elinks. – dotVezz Sep 23 '14 at 19:47
5

// , Consider brow.sh, because of its low bandwidth but extremely flexible support for different kinds of web pages:

enter image description here
https://www.brow.sh

It also has a clever way of using True color support in terminals to render images, and supports modern replacements for SSH like MOSH.

Here are some demo pages:

html.brow.sh
Uses very basic graphics and HTML anchor tags. Although this service may appear similar to the terminal client it does not yet have feature parity.

text.brow.sh
Uses nothing but pure text, better for usage with curl, for instance.

For a demo of the browser, ssh brow.sh

You can also install it via docker pull:

docker pull browsh/browsh

Because brow.sh is Firefox under the hood, you can install Adblock and other extensions.

8

Lynx does not support JavaScript, but Links does:

sudo apt-get install links

then to compile Links with JavaScript support, use the configure option --enable-javascript be aware that is buggy according to the documentation.

Best of luck

  • The comments on the question state that JavaScript is not available on Links by default. So could you please elaborate on how to utilize it? – Tymric Dec 17 '14 at 9:24
  • @Timmy updated! – user10405 Dec 17 '14 at 9:28
  • 1
    It is also buggy apparently (just edited the answer) – user10405 Dec 17 '14 at 9:30
  • 1
    then to compile Links with JavaScript support -- how can I do that? :-) – Ionică Bizău Dec 17 '14 at 9:46
  • 1
    Even if you compile it with JavaScript, I think you have to separately enable it in the configuration. See links.twibright.com/user_en.html#ap-javascript – Brandin Dec 6 '16 at 14:18
3

2017 solution:

Here's a solution for rendering html+js in the terminal:

Required:

  • Chrome 59 or greater
    • Using chrome in headless mode allows you to render a page with javascript through the terminal!
    • (it outputs raw html though)
  • Hermit
    • Simply renders raw html to readable text in the terminal!

Example Usage:

 $ google-chrome --headless --disable-gpu --dump-dom https://javatester.org/javascript.html | hermit

Output:

...
Your web browser supports JavaScript version 1.7
...

It worked!

2

edbrowse

Non-pseudographical browser, ed-like interface.

Documentation: http://the-brannons.com/edbrowse/usersguide.html

Demo session:

$ edbrowse http://softwarerecs.stackexchange.com/
no ssl certificate file specified; secure connections cannot be verified
no trailing newline
74558
6590
# Let's print the beginning of the page
1,20p




{current community}

*
{chat}
{blog}
{Software Recommendations}
*
{Software Recommendations Meta}


your communities


{Sign up} or {log in} to customize your list.

{more stack exchange communities}
# Seach field is not here yet.
# Pressing "Enter" until we find it



{Stack Exchange}

{sign up}

{log in}

{tour}

{help}

* {Tour Start here for a quick overview of the site}

* {Help Center Detailed answers to any questions you might have}

* {Meta Discuss the workings and policies of this site}

 <> <Go implicit>




# Here it is. Let's find the line number
n
32 
28,32n
28 * {Help Center Detailed answers to any questions you might have}
29 * {Meta Discuss the workings and policies of this site}
30  <> <Go implicit>
31 
32 
30
 <> <Go implicit>
# We are now focused on the search field.
i=text browser
 <text browser> <Go implicit>
i*
submitting form
76944
10997
# OK, we have searched. Let's enumerate the results.
# First 30 lines are probably fluff, so begin with 40'th line
40,60p
* {Ask Question}



Search



<text browser>|<search>

127 results


{relevance}
{newest}
{votes}
{active}

10
votes
1answer
# Pressing Enter for more lines

{Q: Text based browser that runs JavaScript}

I am searching for a text browser running JavaScript.

It should be compatible with Linux platform. Other features:
# OK, we are here. Let's follow the link
n
63 It should be compatible with Linux platform. Other features:
58,62n
58 10
59 votes
60 1answer
61 {Q: Text based browser that runs JavaScript}
62 I am searching for a text browser running JavaScript.
61
{Q: Text based browser that runs JavaScript}
g
74946
7226
50,80p
{Text based browser that runs JavaScript}




up vote 10 down vote {favorite}
1

I am searching for a text browser running JavaScript.
It should be compatible with Linux platform.

Other features:
* run JavaScript (this is the most important)
* minor CSS rendering (text colors, background colors, borders maybe)
* support XHR (is supposed to do if it runs js)
* run in command line (terminal)

Any recommendations?

I tried lynx and elinks (sudo apt-get install ...), both not supporting JS.
{linux}
{open-source}
{web-browser}
{command-line}

{share}
{improve this question}
asked Sep 22 '14 at 18:02
{image}
{Ionic\u0103 Biz\u0103u}
3589



| 







2



Call me crazy, but I think {links} supports javascript.

- {dotVezz} Sep 23 '14 at 16:38





@dotVezz If you prove me that, I will give you 100 points. :smile:

Add an answer with the instructions and I will review it.

:-) - {Ionic\u0103 Biz\u0103u} Sep 23 '14 at 16:54





I should have done some google-fu before I commented.

Javascript support is not available by default.

Both it and elinks have an --enable-javascript compile flag.

By default, "{JavaScript support was removed in release 2.1pre29 because it

was buggy.}" So in other words... I probably wouldn't bother with links and elinks.

- {dotVezz} Sep 23 '14 at 19:47





add a comment




# Let's try to add a comment  
n
107 
100,107n 
100 By default, "{JavaScript support was removed in release 2.1pre29 because it
101 was buggy.}" So in other words... I probably wouldn't bother with links and elinks.
102 - {dotVezz} Sep 23 '14 at 19:47
103 
104 
105 add a comment
106 
107 
105
add a comment
# OK, enough for now.
# I don't know why "add a comment" is not shown as a link
q
  • +1 for edbrowse, I tried it some time ago, but I also would like a lynx-like interface. edbrowse is just text, from what I sow. – Ionică Bizău Jan 21 '15 at 16:26
  • Unfortunately edbrowse fails to support JS properly as well: github.com/CMB/edbrowse/issues/2 – Vi. Jan 21 '15 at 21:27
2

As of v0.23, Web Adjuster has a PhantomJS option, which can partially Javascript-enable any browser with the help of PhantomJS. I say "partially" because it's not (yet?) working with POST forms and Javascript-only links, but it's fine for reading the text of a page which requires Javascript before showing you that text.

sudo apt-get install python-selenium # or sudo yum install python-selenium
wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-i686.tar.bz2
tar -jxvf phantomjs-2.1.1-linux-i686.tar.bz2 
cd phantomjs-2.1.1-linux-i686/
sudo mv bin/phantomjs /usr/local/bin/
cd ..
sudo apt-get install python-tornado # or sudo pip-install tornado
wget http://ssb22.user.srcf.net/adjuster/adjuster.py
python adjuster.py --PhantomJS --real_proxy

and in another window or tab

http_proxy=http://localhost:28080 lynx http://site-that-needs-javascript.example.com/

Disclosure: Web Adjuster maintainer here.

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.