Commit graph

33 commits

Author SHA1 Message Date
Thomas Buckley-Houston 8cf3de33c3 Move integration tests to Golang CLI client
After moving to Tcell and implementing its screen diff updates, we can
no longer watch STDOUT to get frames during integration tests. Instead
we need to use Tcell's SimulationScreen and which has a GetContents()
method. This is actually also a much more robust way of being able to
see what Browsh actually outputs during testing.
2018-02-17 14:10:39 +08:00
Thomas Buckley-Houston b5a083e929 Replaced Termbox-go with Tcell
This was primarily to get native diff'ed frame rendering.
Termbox-go doesn't support true colours, thus the switch to Tcell, but
as it turns out Tcell claims to have wider platform support, so it looks
like an especially good change.

So now the CLI will only try to update the terminal screen when cells
actually change. This has some significant performant gains, especially
when using Browsh over SSH.

Also note that this required a complete change of the frame data
structure sent over the websocket. Previously it was a little
structured, but now it is just a plain 1 dimensional array of pure
strings, even the RGB components are sent as integers in strings. If I
can find a way to unmarshal mixed arrays in  Golang then it'll be worth
sending a mixed JSON array to save some compute overhead.
2018-02-14 10:33:39 +08:00
Thomas Buckley-Houston 8c999b5d54 Exclude freebsd build from UPX compression 2018-02-09 11:47:02 +08:00
Thomas Buckley-Houston 819a29c8b6 Mouse wheel scrolling
Also throttle the frame rate to 40ms/ Previously it was redrawing on
every sent STDIN event.
2018-02-09 10:06:54 +08:00
Thomas Buckley-Houston d2f74cefb8 FreeBSD builds. For @RainbowHackerHorse 2018-02-05 16:57:49 +08:00
Thomas Buckley-Houston cf6cde86f7 Added -startup-url and -time-limit args 2018-02-04 18:26:01 +08:00
Thomas Buckley-Houston fc5e72b191 Do FF's first run during docker *build*
This gets around a few problems caused by the fact that Firefox's first
ever run on a new profile is quiet different from a normal startup. Note
that this only effects Browsh in Docker.
2018-02-04 18:02:39 +08:00
Thomas Buckley-Houston c0e51e6413 Use Browsh-specific FF profile.
Also adds `-debug` flag.
2018-02-03 15:21:58 +08:00
Thomas Buckley-Houston cdab6bde93 Bugfixes to Dockerfile 2018-02-02 17:20:37 +08:00
Thomas Buckley-Houston 7117eb9965 Added screenshot feature: press ALT+P
In the endless struggle to squash a Travis-specific bug, we now have
screenshots. Currently the screenshots are of the custom block font
state, so you can't read the text. But I'm planning on changing the
default state of the page to use a normal font - such that the
frame builder needs to toggle the block font on to build a frame. This
will make it more likely that screenshots will contain actual text.
2018-02-01 17:34:25 +08:00
Thomas Buckley-Houston 74538fed0e Fix for zero-width chars in page titles
Also removes the Mozilla Cliqz disclaimer tab on first startup.
Interestingly it has a carriage return in its HTML page title, which is
of course zero-width. But also the fact that this tab can sometimes load
before the requested tab at startup is a showstopper for automated
tests.
2018-01-31 15:40:43 +08:00
Thomas Buckley-Houston 0b3ff030cd Release v0.2.3 2018-01-30 17:50:55 +08:00
Thomas Buckley-Houston 2985774859 Automate releases 2018-01-28 16:08:19 +08:00
Thomas Buckley-Houston 221aa56869 Log Firefox's core debugging console to stdout
Includes the addition of a function to set Firefox preferences at
startup.
2018-01-24 16:32:52 +08:00
Thomas Buckley-Houston 9a82182a9a Don't use --new-instance, -P when launching FF 2018-01-24 10:59:57 +08:00
Thomas Buckley-Houston 318f5c3c34 First draft of integration tests 2018-01-23 20:04:23 +08:00
Thomas Buckley-Houston b387f66c69 Launch and install webextension from client
This means that Browsh can now be entirely run just by running the CLI
binary. The client launches Firefox as a subprocess, then connects to it
via the Marionette protocol, installs the webextension and finally
triggers a new tab with, currently, the Google homepage in it.

I was trying to set this up for automated testing as well by installing
the built webextension as a temporary addon, because otherwise you need
to sign the extension everytime with a unique semantic version. However
for some reason I can't quite recreate the environment that MDN's
`web-ext` creates. The extension installs fine but fails to load the
`content.js` script, I can't find a backtrace or any other details about
the failure. So for now, we're just going to have to use `web-ext` as
seperate process and have the client connect to that. Which is what one
should do during development anyway, so it's not a huge loss.
2018-01-21 11:56:05 +08:00
Thomas Buckley-Houston 4177bff127 First draft of mouse down/up/click support 2018-01-17 11:00:37 +08:00
Thomas Buckley-Houston 97a36b68b4 First drafy of UI: tabs and URL bar 2018-01-12 21:58:32 +08:00
Thomas Buckley-Houston ad59dc3ce4 Basic up/down scrolling 2018-01-11 12:22:27 +08:00
Thomas Buckley-Houston d2aaa33963 Refactored webext background script 2018-01-10 22:54:51 +08:00
Thomas Buckley-Houston 27e0b2ddc6 First working draft of Golang interfacer
After weighing up the options it seems that Golang's termbox-go TTY
library has better support for terminals, and it's cross-platform out of
the box. So this commit is the first working version where the
interfacer launches a websocket server, makes a connection to the
webextension and listens to STDIN from the CLI, sending all input to the
webextenstion.
2018-01-07 11:21:29 +08:00
Thomas Buckley-Houston d00361f87d First draft of rewrite to Webextension and Rust
This proves that frames can be generated on Firefox using the canvas and
a Tree Walker to examine text nodes. Already with little optimisation
frames don't ever take longer than 200ms to render.

Chrome has a MediaStream of the viewport, hopefully that will prove
performant as well.

This doesn't have functioning text colour detection or text occlusion
support. But early research suggests this will possible by comparing 2
screenshots: one with and the other without rendered text.
2018-01-01 21:50:30 +08:00
Thomas Buckley-Houston 73604f1044 Don't print 'KB OFF' on every render. Prevents glitches in non-KB mode 2016-08-02 19:08:26 +05:30
Thomas Buckley-Houston 1453c01621 Keyboard mode. For terminals with no/bad mouse support.
Closes #5
2016-06-25 22:30:50 +09:00
Thomas Buckley-Houston 576821fa37 Provide CTRL+ALT+Q to cleanly exit 2016-06-03 13:31:00 +09:00
Thomas Buckley-Houston e9f5124a45 'docker run' command for remote install was wrong. 2016-05-22 18:29:58 +09:00
Thomas Buckley-Houston bea7b7c4d0 Change xdotool command for spacebar from 'Space' to 'space' 2016-05-22 09:48:05 +09:00
Thomas Buckley-Houston 09168fc8ea Just some atom-beautify to make code look better 2016-05-21 14:47:02 +09:00
Thomas Buckley-Houston 093b5ad07e Expands texttop to full size of current terminal 2016-05-21 14:11:25 +09:00
Thomas Buckley-Houston 8acb1bcb96 Just some simple refactoring and tidying up 2016-05-21 12:22:12 +09:00
Thomas Buckley-Houston 653eb6b1d7 Panning working well. This is now very, very usable. Time to tidy up. 2016-05-21 02:01:52 +09:00
Thomas Buckley-Houston 13d9fadf41 Fixed zoom bug by writing some tests. Also moved thigns around a lot. 2016-05-20 23:51:57 +09:00