Lead Image © yemelyanov, 123RF.com

Lead Image © yemelyanov, 123RF.com

Call web pages in the terminal with Browsh

Block Graphics

Article from ADMIN 53/2019
By
The Browsh command-line browser displays web pages with text characters and thus supports true-to-layout browsing at the command line.

A graphical user interface is not always available (e.g., when working with secure shell (SSH) on a remote server), and in some areas, data merely drips from the Internet. If you want to save bandwidth or work at the command line, you will appreciate a pure text browser. Browsh takes this one step further and even converts images and videos into characters. For this to work, the browser relies on a well-known friend in the background: Firefox.

Shell Fan

Many Linux users prefer the command line to a graphical user interface. If you are a die-hard shell fan and want to look up something on the Internet, web browsers like the classic Lynx that only deliver plain text on a page can help – and save bandwidth in the process. However, you lose the layout and images.

A modern text browser composes a web page completely from text characters [1], keeping the layout to a large extent. The software even tries to display graphics and animation consisting of individual color blocks (Figure 1). In many cases, you can at least guess the appearance of the graphic.

Figure 1: Browsh transforms a web page, like this one from Linux Magazine, into a down-mix of graphics and text. The results are not always perfect.

The software supports all modern web technologies, including HTML5, CSS3, JavaScript, and even WebGL. Developer Thomas Buckley-Houston sees the main use of the program in work sessions on a remote server. If you access Browsh with SSH or the alternative Mosh, you can access the web with the locally installed browser. Because Browsh only transfers text, the total volume of data to be transferred is reduced, boosting the transfer speed.

Test Drive

If you only want to try Browsh out first, simply add another URL to the address https://html.brow.sh/ and call the complete construct in a normal web browser:

https://html.brow.sh/http://www.linux-magazine.com/

After a few seconds, you will see the corresponding website as Browsh would display it (Figure 2). Complementary to html.brow.sh is the domain text.brow.sh, which delivers a display that contains only the text of the corresponding page.

Figure 2: With the html.brow.sh service, you can test the Browsh results – in this case the Linux Magazine homepage.

Alternatively, you can connect to the brow.sh server. Registration is not required. After a few seconds, Browsh starts and is ready for testing.

However, the service only runs for five minutes and records all the actions you perform. It only serves to test the software without obligation. Additionally, some JavaScript does not run correctly, and the computer prevents logging on to services on the network.

Firefox

Browsh uses a little trick when it displays websites: It starts Firefox in the background in headless mode without a user interface and then installs its own extension that instructs Firefox to retrieve and assemble the web page.

Browsh injects some scripts and CSS into the page. The CSS in particular is intended to ensure that the page is aligned with the terminal's grid. Finally, the software converts the result so that it can be displayed as plain text.

Accordingly, Browsh requires Firefox as of version 57 and a terminal that offers a true color (24-bit) display as the basis. In case of doubt, the browser can also be switched to black-and-white mode.

If your system meets these requirements, go to the Browsh download page and download the package that matches the distribution you are using. If in doubt, use Linux Static . For 64-bit systems, click x64 ; for 32-bit systems, click 386 .

After downloading, rename the file to browsh; then, assign the appropriate run permissions and call the text browser in the terminal:

chmod +x browsh
browsh

If you are working with Docker, you should start the software in a container with a current version of Firefox running:

$ docker pull browsh/browsh
$ docker run -it --rm browsh/browsh

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy ADMIN Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Application security testing with ZAP in a Docker container
    Pitting the OWASP Zed Attack Proxy against an insecure web app in a Docker container illustrates how you can tick a lot of security checkboxes.
  • Managing access credentials
    Most Internet services require password-protected individual accounts. A password manager can help you keep track of all your access credentials.
  • Linux alternatives to Windows software
    Free software alternatives to common commercial Windows programs often are little understood. We show which applications on the Linux desktop give an especially good account of themselves.
  • Guacamole: Remote Desktop

    HTML5 offers a range of new features, such as audio and video support, without needing plugins like Flash or Java. This opens up completely new options in terms of content delivery via the web – and for mobile access to applications on the LAN.

  • Remote access with ThinLinc 4.12
    The revival of terminal servers during the Covid-19 crisis depended on the IT administrator to enable home office workplaces, with the help of tools like ThinLinc, a Linux remote desktop server.
comments powered by Disqus