browsh/README.md

106 lines
5.6 KiB
Markdown
Raw Normal View History

2018-08-03 15:08:16 +00:00
[![Build Status](https://travis-ci.org/browsh-org/browsh.svg?branch=master)](https://travis-ci.org/browsh-org/browsh) [![Follow @brow_sh](https://img.shields.io/twitter/follow/brow_sh.svg?style=social&label=Follow)](https://twitter.com/intent/follow?screen_name=brow_sh)
![Browsh Logo](https://www.brow.sh/assets/images/browsh-header.jpg)
**A fully interactive, realtime, and modern text-based browser rendered to TTYs and browsers**
2018-07-07 15:12:43 +00:00
![Browsh Gif](https://media.giphy.com/media/bbsmVkYjPdOKHhMXOO/giphy.gif)
## Why use Browsh?
2018-02-09 03:33:59 +00:00
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,
2018-07-08 09:07:10 +00:00
[elinks](https://github.com/browsh-org/browsh/issues/17). That way the
2018-02-09 03:33:59 +00:00
_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.
2018-01-23 04:28:56 +00:00
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
2018-07-09 13:39:51 +00:00
is running somewhere else on mains electricity.
## Installation
2016-05-21 09:38:46 +00:00
2018-07-18 11:56:48 +00:00
Download a binary from the [releases](https://github.com/browsh-org/browsh/releases) (~7MB).
You will need to have [Firefox 63](https://www.mozilla.org/en-US/firefox/new/) (or higher) aleady installed.
2018-06-23 09:16:12 +00:00
Or download and run the Docker image (~230MB) with:
2018-07-12 00:01:12 +00:00
`docker run --rm -it browsh/browsh`
2018-01-23 04:28:56 +00:00
## Usage
Most keys and mouse gestures should work as you'd expect on a desktop
browser.
For full documentation click [here](https://www.brow.sh/docs/introduction/).
## Contributing
To setup a dev env you will need NodeJS and Golang installed. If you get stuck
setting up your env, take a look in `.travis.yml`, it has to setup everything
from scratch for every push to Github.
I'd recommend [nvm](https://github.com/creationix/nvm) for NodeJS - note that
`nvm install` will automatically parse the `.nvmrc` version in this repo to get
the correct NodeJS version. For Golang it's probably best to just use your OS's
package manager. The current Golang version being used is stored in `.travis.yml`.
You'll then need to install the project dependencies. For the webextension, just
run: `npm install` inside the `webext/` folder. For the CLI client you will first
need to install `dep`, there is a script for this in `interfacer/contrib/setup_dep.sh`.
I don't fully understand Golang's best practices, but it seems you are forced to
keep your Go project's code under `$GOPATH/src`, you might be able to get away
with symlinks. Anyway, to install the dependencies use: `dep ensure` inside the
`interfacer/` folder.
Then the ideal setup for development is:
* have Webpack watch the JS code so that it rebuilds automatically:
`webpack --watch`
* run the CLI client without giving it the responsibility to launch Firefox:
2018-08-27 16:46:02 +00:00
`go run ./interfacer/src/main.go --firefox.use-existing --debug`
* have Mozilla's handy `web-ext` tool run Firefox and reinstall the
webextension everytime webpack rebuilds it: (in `webext/dist`)
2018-06-12 13:01:31 +00:00
`web-ext run --verbose`
2016-05-21 09:38:46 +00:00
For generic Linux systems you can follow [this guide](https://github.com/browsh-org/browsh/blob/master/contrib/setup_linux_build_environment.md) on how to setup a build environment, that you may be able to adapt for other systems as well.
Windows users can follow [this guide](https://github.com/browsh-org/browsh/blob/master/contrib/setup_windows_build_environment.md) in order to set up a build environment.
2018-10-03 06:32:36 +00:00
Mac users may follow [this guide](https://github.com/browsh-org/browsh/blob/master/contrib/setup_mac_build_environment.md) that goes through the steps of setting up a build environment.
2018-08-10 22:51:37 +00:00
### Communication
Questions about Brow.sh? Stuck trying to resolve a tricky issue? Connect with the Brow.sh community on [Gitter](https://gitter.im/browsh)!
## Building a Browsh release
If you'd like to build Browsh for a new package manager, or for any other reason,
2019-10-24 21:39:06 +00:00
you can use the script at `interfacer/contrib/build_browsh.sh` as a guide. Note
you won't be able to build the web extension as Mozilla only allows one canonical
version of web extensions per version number. So the build script downloads the
official web extension `.xpi` file from the Mozilla archives.
## 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
* [@tobimensch](https://github.com/tobimensch) For essential early feedback and user testing.
* [@arasatasaygin](https://github.com/arasatasaygin) For the Browsh logo.
## License
GNU Lesser General Public License v2.1