Earlier quoted context omitted.
Ha, that's a very long story. The gist though is that some custom CSS forces a given webpage into a strict, monospaced, mono-sized grid. Then JS queries DOM text nodes for their contents and precise positions. Then using the standard rules of text flow the exact position of every character can be fairly reliably derived.
that's beautiful, where can we find this cool CSS file?
Show HN: Browsh – A modern, text-based browser
231–240 of 330 posts
Re: Show HN: Browsh – A modern, text-based browser
#232Earlier quoted context omitted.
I could see this being part of a lightweight browser UI testing framework. There's already ways to drive a headless UI (Selenium, puppeteer), but they require automation testers to interact with page elements via the "normal" DOM which can be quite painful in terms of creating automation tests - DSLs to drive DOM automation are necessarily huge. I could envision browser automation via browsh using a very small DSL e.…
I've thought of that too. The trouble is that Browsh's text renderer is more of a science than an art. It's quite hard to actually get a guarantee of the same text twice, which is a pretty important condition of testing. But yes, I'd love for Browsh to be used in such a way!
EDIT: Since Browsh depends on Firefox I'm curious whether it's actually faster than a graphical browser.
Re: Show HN: Browsh – A modern, text-based browser
#233 $ ssh brow.sh
(It starts, prints "Waiting for Firefox to connect")Then...
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x6de976]
goroutine 11 [running]:
browsh/interfacer/src/browsh.handleMouseEvent(0xc4203d3b00)
/home/travis/gopath/src/browsh/interfacer/src/browsh/tty.go:151 +0x36
browsh/interfacer/src/browsh.readStdin()
/home/travis/gopath/src/browsh/interfacer/src/browsh/tty.go:46 +0xd3
created by browsh/interfacer/src/browsh.TTYStart
/home/travis/gopath/src/browsh/interfacer/src/browsh/browsh.go:185 +0xf2
Connection to brow.sh closed.Re: Show HN: Browsh – A modern, text-based browser
#234Earlier quoted context omitted.
It should be quite doable to spin up a container/VM on demand. I'd probably look at lxd/lxc or bsd jails for this (both with zfs for storage) - or if there now are any real ways to run containers under hw virtualization - maybe that. Maybe something like: https://github.com/rkt/rkt/blob/master/Documentation/running... for VM backed containers - but I'm not sure if it's considered stable and/or secure.
Thanks for the suggestion. I'm already using Kubernetes/Docker for the `ssh brow.sh` service. What advantages would your approach have?
But hw isolation might be worth investigating - as others are saying - hostile access to a web browser, including webmail etc - is pretty dangerous. And plain docker never had a good story wrt secure isolation.
Apparently there was "hypernetes", now stackube - for combining VM runtime and kubernetes:
https://kubernetes.io/blog/2016/05/hypernetes-security-and-m...
https://github.com/openstack/stackube
As far as I can tell, this allows the mix of k8 style pod/container management and VM level isolation:
https://stackube.readthedocs.io/en/latest/stackube_scope_cla...
As for lxd/freebsd jails and zfs - both offer very nice and easy to grasp environment for isolated services - and both should end a little more isolated than a typicaldocker setup (some services running as root in container, no additional lxc restrictions).
But all things considered, if you already have k8/docker set up to give every user a separate, possibly ephemeral container... Infrastructure is probably not where I'd devote most time. It should work well enough as is.
Re: Show HN: Browsh – A modern, text-based browser
#235Sounds great, will bookmark for later.
Re: Show HN: Browsh – A modern, text-based browser
#236Re: Show HN: Browsh – A modern, text-based browser
#237Can someone explain the usecase for Text-based browsers? While they're fun to show off to my non-tech friends when running without X11 and looking like a hacker, I've never needed one.
Re: Show HN: Browsh – A modern, text-based browser
#238Earlier quoted context omitted.
AAlib [0] has been around for ages. But yeah, it's a cool trick to watch movies in a terminal. However I think there is very little real use for image to text-as-image conversion. [0] https://en.m.wikipedia.org/wiki/AAlib
Or libcaca, which even handles colors. With mpv & youtube-dl, you can do just: mpv -vo caca "https://www.youtube.com/watch?v=DLzxrzFCyOs"
I didn't know about this utility. Awesome it does sound too. Thanks for pointing it out.