Call web pages in the terminal with Browsh
Block Graphics
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.
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.
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
(incl. VAT)
Buy ADMIN Magazine
Subscribe to our ADMIN Newsletters
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Most Popular
Support Our Work
ADMIN content is made possible with support from readers like you. Please consider contributing when you've found an article to be beneficial.