browsh README

The project's README from github.com/browsh-org/browsh. As one markdown file: README.md.

Follow @brow_sh

Browsh Logo

A fully interactive, real-time, and modern text-based browser rendered to TTYs and browsers

Browsh GIF

Why use Browsh?

Not all the world has good Internet.

If you only have a 3kbps internet connection tethered from a phone, then it's good to SSH into a server and browse the web through, say, elinks. That way the server downloads the web pages and uses the limited bandwidth of an SSH connection to display the result. However, traditional text-based browsers lack JS and all other modern HTML5 support. Browsh is different in that it's backed by a real browser, namely headless Firefox, to create a purely text-based version of web pages and web apps. These can be easily rendered in a terminal or indeed, ironically, in another browser. Do note that currently the browser client doesn't have feature parity with the terminal client.

Why not VNC? Well VNC is certainly one solution but it doesn't quite have the same ability to deal with extremely bad Internet. Terminal Browsh can also use MoSH to further reduce bandwidth and increase stability of the connection. Mosh offers features like automatic reconnection of dropped or roamed connections and diff-only screen updates. Furthermore, other than SSH or MoSH, terminal Browsh doesn't require a client like VNC.

One final reason to use terminal Browsh could be to offload the battery-drain of a modern browser from your laptop or low-powered device like a Raspberry Pi. If you're a CLI-native, then you could potentially get a few more hours of life if your CPU-hungry browser is running somewhere else on mains electricity.

Installation

Download a binary from the releases (~11MB). You will need to have Firefox already installed.

Or download and run the Docker image (~230MB) with: docker run --rm -it browsh/browsh

Usage

Most keys and mouse gestures should work as you'd expect on a desktop browser.

For full documentation click here.

Development

The Firefox Web Extension

This is needed to run essential JS inside web pages so that they render in a way that Browsh can consume.

You will need to install nodejs, usually available from your OS package manager. Though for development purposes the recommended method is with https://mise.jdx.dev.

Then in the webext directory

The browsh Golang code

You will need to install go, usually available from your OS package manager. Though for development purposes the recommended method is with https://mise.jdx.dev.

Then in the interfacer directory

Logs will be available in interfacer/debug.log

Tests

For the webextension: in webext/ folder, npm test
For CLI unit tests: in /interfacer run go test src/browsh/*.go
For CLI E2E tests: in /interfacer run go test test/tty/*.go
For HTTP Service tests: in /interfacer run go test test/http-server/*.go

Special Thanks

Donating

Please consider donating: https://www.brow.sh/donate

License

GNU Lesser General Public License v2.1

browsh (browsh-org/browsh)

Searching Database…

19.1K ·GitHub
Что это такое?Browsh — это полностью современный текстовый браузер: он отображает настоящие веб-страницы и веб-приложения в виде чистого текста прямо в терминале, а в фоновом режиме всю работу выполняет headless Firefox.
То есть это как elinks или w3m, или что-то другое?Идея похожая, но классические текстовые браузеры не умеют в JS и современный HTML5. Browsh работает поверх настоящего браузера (headless Firefox), поэтому полноценно работают современные страницы и веб-приложения — просто на выходе получается текст.
Как его запустить?Скачайте бинарник примерно на 11 МБ со страницы релизов (Firefox уже должен быть установлен на машине), либо вообще пропустите установку и возьмите Docker-образ на ~230 МБ: docker run --rm -it browsh/browsh
Он умеет открываться и в обычном браузере — этот вариант по удобству такой же, как терминал?Пока нет: в README предупреждают, что браузерный клиент не имеет паритета функций с терминальным, так что полный опыт доступен именно в терминале.
Зачем вообще сидеть в интернете через терминал?В основном это люди с очень медленным интернетом: вы подключаетесь по SSH к серверу, Browsh скачивает там полные страницы, а по вашему соединению идёт только текст. Это ещё и разгружает ноутбук или слабую Raspberry Pi от работы браузера, который сажает батарею.
А можно работать через Mosh вместо обычного SSH?Да. Терминальный Browsh умеет использовать Mosh, чтобы ещё снизить трафик и держать сессию стабильной: после обрыва или смены сети соединение переподключается автоматически, а передаются только изменения экрана.
Почему бы просто не использовать VNC при плохом соединении?Аргумент из самого README: VNC не справляется с очень плохим интернетом, а терминальному Browsh на клиентской стороне не нужно ничего, кроме SSH или Mosh. В придачу прожорливый по CPU браузер работает где-то в стороне, на сети от розетки.
На чём Browsh устроен внутри?Из двух частей: веб-расширение для Firefox (JavaScript, собирается через npm и webpack), которое запускает нужный JS внутри страниц, чтобы Browsh мог их обрабатывать, и «интерфейсер» на Go, который запускается командой go run ./cmd/browsh --debug.
Creator
browsh-org
Size
7.8 MB
Stars
19.1K
Age
10y
Commits · 90 Days