Wykres commitów

427 Commity (master)

Autor SHA1 Wiadomość Data
Thomas Buckley-Houston b671a6c6b3 Drag and Drop mouse movement!
Not really sure why but `new MouseEvent` was always sending the coords
to the same place within an element, not matter where you clicked. Now
using initMouseEvent(), the click actually goes to the place on the
viewport where you clicked.
2018-06-05 15:51:27 +08:00
Thomas Buckley-Houston 707a433385 Better rules for finding input boxes
Google maps doesn't use a [type=text], or any kind of type attribute for
its search box. Plus it also has a [aria-hidden=true] input box that
Browsh was detecting and covering the actual active search box.
2018-06-05 15:25:57 +08:00
Thomas Buckley-Houston 8d958b0256 Readded the browser resize height magic number
This fixes a bug where the bottom of web pages wouldn't get parsed.

And also another bug where mouse clicks at the bottom of a page
wouldn't render.
2018-06-05 15:01:52 +08:00
Thomas Buckley-Houston e937f81a60 Added shortcut to toggle a mobile user agent 2018-06-05 14:40:03 +08:00
Thomas Buckley-Houston 5b575110b1 Include role="textbox" elements as an input boxes
This just about allows you to use Gmail
2018-06-04 21:29:43 +08:00
Thomas Buckley-Houston 07fd062510 Stackoverflow.com-related fixes
Stackoverflow surfaced a few bugs;

1. For some unknown reason it measures the em value of a single
character as having something like 10,000 pixels width. So for now I'm
just hardcoding the standard measurement of 9x15 for unreasonably large
widths.

2. Its cookie banner used `position: fixed !important`, so needed to
update the sticky fix code in case other sites do the same.

3. The cookie banner with the aplied sticky fix meant that the div just
sat staticlly in the middle of the DOM obscuring other text. So I
started a list of site-specific CSS specifics.
2018-06-04 21:01:46 +08:00
Thomas Buckley-Houston eb1176b8c3 Fixes for text that clobbers other text
During the text builder process its possible that a character tries to
fit onto a TTY cell that already has a character. There are multiple
reasons for this, the main one being hidden text. This commit changes
the method for deciding the priority of character to using the
`elementFromPoint(x, y)` method.

This commit also includes a fix to re-parse all text when there's a
mousedown event.
2018-06-04 20:03:59 +08:00
Thomas Buckley-Houston e2d39ba56c Prevent sticky elements from being sticky
Sticky elements are, for example, those headers that follow you
down the page as you scroll. They are annoying even in desktop
browsers, however because of the lower frame rate of Browsh, sticky
elements stutter down the page, so it's even more annoying. Not to
mention the screen real estate that sticky elements take up, which
is even more noticeable on a small TTY screen like Browsh's.
2018-06-04 17:52:00 +08:00
Thomas Buckley-Houston 7232ac120f Bug fix: improved line formatting
There was a long standing problem where random gaps would appear
between lines. The fix was to change a magic number that adds an extra
few pixels to the reported height of the 'em' character dimensions.
Unfortunately I don't know what this magic number actually does. It
might represent the distance between lines?
2018-06-04 17:02:15 +08:00
Thomas Buckley-Houston 72c74f1905 Fixes bug in HTTP Service rendering
I think with the recent change to the method of hiding text by using a
dedicated blank font, the initial page load and parsing (upon which the
HTTP Service very much depends), browser window resizes were causing a
delay in the time taken for text to be properly parsed, resulting in
mostly empty raw text pages.

The fix was to ensure that the BlankMono.ttf font was loaded with the
initial page load, by using the webextensions injected style.css file.
2018-06-04 15:51:47 +08:00
Thomas Buckley-Houston cc23f0ab3e Increased big text frames to size 6
That's that frames 6 times as big as the TTY are passed at once. This
lessens the likelihood of catching a glimpse of unparsed webpage as
you're scrolling down quickly.
2018-06-03 20:06:33 +08:00
Thomas Buckley-Houston 02bc0aad93 Hide/Show text using seperate font
Previously we were using CSS to make the text's colour transparent.
However that proved to cause a lot of problems with pre-existing
transition animations in the host webpage. There didn't seem to be
anyway to disable the transition time for text transitioning to
transparent, without also disabling all transitions.

Also added censorship to password input boxes.
2018-06-03 19:54:38 +08:00
Thomas Buckley-Houston c8d5d09de7 First implementation of text selection
This is so you can immediately clear the URL bar upon toggling. Which
saves you holding down the backspace key if you want to ente a new URL.

Only for input boxes. And SHIFT-ARROW isn't implemented.
2018-06-03 13:12:31 +08:00
Thomas Buckley-Houston 55c70d9e5e Multiline text input boxes
No doubt a lot of this code is reinventing the wheel, after all this is
basically now a simple text editor. I'm sure there'll be a few bugs to
iron out.
2018-06-02 18:47:37 +08:00
Thomas Buckley-Houston b78abbf26f Overflow scrolling for single line input boxes
Such a basic thing, that we take it for granted. But it's actually a bit
tricky to implement.
2018-05-28 22:03:33 +08:00
Thomas Buckley-Houston 0fc39a51e6 HTTP Server service: fetches URL, returns raw text
Using the `-http-server` argument will now start Browsh in HTTP Server
mode. It will accept request like this:

  `curl brow.sh/http://news.ycombinator.com`

This will return a plain text version of the Hacker News front page,
with a width of 100 characters, with each line separated by a line
break.
2018-05-27 20:45:43 +08:00
Thomas Buckley-Houston 4b84d52ae1 Backspace goes back in history
Also:
  * Use webextension to navigate URLs instead of the DOM. This means
    that crashed pages can still be navigated away from.
  * An attempt to implement mouse dragndrop, but it doesn't work :(
2018-05-25 18:48:57 +08:00
Thomas Buckley-Houston f2d9d44268 Minor: fix unit and integration tests
Unit tests needed tab objects to be created.

Integration tests needed more max time for start up and to make sure
that the final tab doesn't get closed.
2018-05-25 15:43:22 +08:00
Thomas Buckley-Houston 938d51b692 Tabs! As we all know and love
Adding, cycling, deleting. The width of the tab handle is currently
fixed to 20. And if there are more tabs than can fit in the tab bar then
the extra ones just dissapear off to the right, but they can still be
cycled to with CTRL-Tab.

The marks the end of feature development in preperation for a version
1 release.
2018-05-24 18:45:07 +08:00
Thomas Buckley-Houston 5c7ff71c79 Input boxes, for searches, logins, writing, etc
Input boxes are currently only one line and to not properly wrap. So
textareas are also one line. TBC...

Also includes:
  * First implementation of the DOM MutationObserver. This needs to have
    an eye kept on it in case some websites trigger too mutatation
    events. For now it doesn't seem too bad. Although strangely it seems
    to stop on Youtube after about 15 seconds.
2018-05-20 21:17:33 +08:00
Thomas Buckley-Houston 9dc0f0a08f Webext: default to hiding text in webext
Text in the real browser only needs to be displayed when parsing with
the Text Builder in order to get the text's colour and z-index. Text
parsing should be done in frequently as it likely doesn't change often.
However graphics building of the current viewport is set to
automatically parse ever 250ms and it doesn't need to know anything
about text. So there's no point defaulting to having text on and hiding
it for every graphics frame.

This tweak has improved the perforance of the graphics parsing for small
frames (the same size as the viewport) from around 100ms to around 4ms!

There are still some curious and inexplicable CPU spikes when
scrolling... TBC
2018-05-08 14:07:54 +08:00
Thomas Buckley-Houston fff7c2e413 Only parse text that is within a sub-frame
This improves the performance of parsing and rendering text
2018-05-08 13:45:22 +08:00
Thomas Buckley-Houston 7a8811c526 Webext can now reconnect to a re-opened TTY
Albeit it is quite slow to notice the re-opened TTY client :/
2018-05-08 13:30:08 +08:00
Thomas Buckley-Houston dd4a29f04a Send 'sub-frames' rather than the whole DOM
Firstly, this improves performance on a larger pages. But it also
prevents browser crashes a very large pages by setting a limit to how
much work is done per frame.

Also includes:
  * Thread safe cell map for simultaneously reading and writing to the
    buffered frame of TTY cells.
  * Improved webext tests so that they programmaticlly build DOM rects
    based off simple text strings.
2018-05-05 16:43:10 +08:00
Thomas Buckley-Houston ae44a18cfc Moved URL bar input and mono mode toggle to CLI
Finally fixes integration tests
2018-04-28 19:02:40 +08:00
Thomas Buckley-Houston b605965e77 Move UI building to CLI
* CLI is now prepared for supporting multiple tabs.
  * Refactored global vars into relevant files
  * Now using real types in JSON sent to CLI
  * Still doesn't fix integration tests
2018-04-28 12:18:34 +08:00
Thomas Buckley-Houston ba5ce3c58b Move frame building from webext to CLI
This offloads significant CPU load from the browser. However it's become
clear that the previous feature of parsing the entire DOM needs to have
an upper limit imposed. For instance large Wikipedia pages still cause
problematic CPU load.

This commit does not fix the broken UI so integration tests fail.
2018-04-22 22:59:00 +08:00
Thomas Buckley-Houston c0f5fcca69 Compose frames of whole DOM, for faster scrolling
Instead of mirroring the browser's viewport, as if we had a camera over
the browser, the entire DOM is now sent in the frame. This means that
the CLI itself can scroll without having to wait for updates from the
webextension screenshotter.
2018-04-18 21:11:04 +08:00
Thomas Buckley-Houston 5b6cc89770 Refactored webext classes to be more SRP
The biggest refactor is separating out the DocumentBuilder from the DOM
Manager.

I also made consistent use of the mixin pattern I'd only half
implemented.
2018-04-09 18:36:46 +08:00
Thomas Buckley-Houston 34497c88aa Better test logging 2018-04-07 12:55:05 +08:00
Thomas Buckley-Houston 1acb178fa7 Lots of new integration tests 2018-04-07 11:35:17 +08:00
Thomas Buckley-Houston 3d0b2ec9c8 Split main browsh code into separate files 2018-04-01 17:03:21 +08:00
Thomas Buckley-Houston c0a79caf4e Refactor Browsh Go code into package
This helps with isolating the tests and refactoring the code into
separate files.
2018-04-01 16:31:25 +08:00
Thomas Buckley-Houston 640f191e61 Added adblocking to /etc/hosts in Docker image 2018-02-17 18:29:14 +08:00
Thomas Buckley-Houston 101b10b0e0 Use `which` when deciding if Firefox binary exists 2018-02-17 16:14:10 +08:00
Thomas Buckley-Houston c44e218c8a Bump to v0.2.13
FPM failed again :/
2018-02-17 15:16:21 +08:00
Thomas Buckley-Houston 29f4dce00b Bump to version 0.2.12 2018-02-17 15:08:07 +08:00
Thomas Buckley-Houston c9e0a9ecc4 Hack to force true colours 2018-02-17 15:06:11 +08:00
Thomas Buckley-Houston 8b042b2479 Added PAGEUP and PAGEDOWN key movement 2018-02-17 15:02:50 +08:00
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 60c20ee404 Release v0.2.11
Sigh, it's annoying that if the release block fails then we have to bump
the version :/ It's because the Mozilla Addon XPI version can be
re-released.
2018-02-09 11:52:19 +08:00
Thomas Buckley-Houston e1c8cf8a45 Release v0.2.10 2018-02-09 11:47:45 +08:00
Thomas Buckley-Houston 8c999b5d54 Exclude freebsd build from UPX compression 2018-02-09 11:47:02 +08:00
Thomas Buckley-Houston 30b83d9d8f Release v0.2.9 2018-02-09 11:34:24 +08:00
Thomas Buckley-Houston 043292d66b README updates
Make it less about me.
2018-02-09 11:33:59 +08:00
Thomas Buckley-Houston 3091510a08 Fixes bug: "undefined" when clicking on URL bar 2018-02-09 11:25:11 +08:00
Thomas Buckley-Houston bb313f568a Added a monochrome mode: ALT+M to toggle
TODO: Still needs a way to represent clickable text
2018-02-09 11:13:33 +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 f624ea00f1 Forgot to bump the version in manifest.json 2018-02-08 20:28:12 +08:00