Live data from Hacker News

Show HN: Browsh – A modern, text-based browser

brow.sh

231–240 of 330 posts

Re: Show HN: Browsh – A modern, text-based browser

#231
post #75

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?

from a quick peek at the GH repo, https://github.com/browsh-org/browsh/blob/master/webext/asse... and the JS in the surrounding extension code?

Re: Show HN: Browsh – A modern, text-based browser

#232
post #165

Earlier 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!

Guaranteeing the same text twice might not be so important. There are pixel comparison testing tools for popular browsers. Your advantage is probably speed. Would cypress end-to-end tests run way faster in Browsh than in a graphical browser? If so, you've got something of value to big companies. You might want to partner with or contract for Cypress.

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

#234
post #180
post #155

Earlier 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?

I don't think I'd look too hard at lxd or freebsd as you already have a docker setup.

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

#237

Can 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.

I once worked with a software system where the preferred way of interacting with its admin features was using lynx. It's a great way to provide menu-based software configuration.

Re: Show HN: Browsh – A modern, text-based browser

#238
post #157
post #133

Earlier 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"

Haha, I knew I was going to be rick-rolled before running this and yet I ran it anyway.

I didn't know about this utility. Awesome it does sound too. Thanks for pointing it out.

Post reply on HN