Switched to Go1.21 to use the log/slog package for strutctured logging.
TODO: Log messages that are stringifying objects can now use strutctured
output.
TODO: Customise log levels for different messages.
Fix tests
* interfacer: Move to Go modules.
* interfacer/contrib: remove dep usage.
No longer needed due to the move to Go modules.
* Move src/main.go to cmd/browsh/main.go.
Allows installation with `go install ./cmd/browsh`, no need to specify
output.
* interfacer/src/browsh/firefox: fix browsh.xpi path
* setup_linux_build_env: clean up and update.
- Remove references to dep and GOPATH
- Use code blocks for commands
- Update for new build instructions
This has been a long time coming, but it's still not perfect. Basically
I'm trying to reset the entire environment as much as possible so that
each spec runs in a clean room. Mostly in this commit Firefox is being
killed and restarted for every spec, which has made a lot of
improvements.
My hunch is that, since the switch to using brow.sh as the default
homepage, the extra page load time has an undesirable effect on
subsequent requests for new tabs. For example, say that a new tab
is requested but the original brow.sh tab hasn't completed, but
it does complete halfway through another tab loading. Might it retake
focus and prevent DOM load events triggering in the user-requested
tab?
So for now, the quickest fix is just to increase the wait time in the
tests. The better fix, if my hunch is right, would be to detect and
wait for the original launch-time tab to finish.
There's a bit of refactoring in order for the webextension to deal with
the new order of initialisation now that config is sent by the Golang
client.
Closes#83
Includes change of CLI args, many of been moved to the config file and
those that remain begin with `--` not `-` and may be worded differently.
Touches #37
There was a bug where raw text pages would unusually truncated. It
seemed to coincide with the char dimensions being incorrectly
calculated. My only guess was that it was because of race condition on
lightweigh sites that didn't load Browsh's webextension code in time.
So for now it just seems better to hard code the char dimensions, which
should at least be more reliable than the bugs of dynamically
calculating them .
This means you can now load the raw text in a browser and the resulting
page will have basic blue links that can be clicked on that will in turn
be loaded by the HTTP service.
A significant feature, so worthy of a minor version bump to;
v1.1.0
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.