11 ms·
Forking Chrome to render in a terminal
- azalemeth 4y agoThis is both genuinely very impressive and also brings me hope that I can finally use Microsoft SSO only services natively in the console...
- sramsay 4y agoHadn't thought of that. Take my money!
- moondev 4y agoI immediately thought of SSO use cases that require the browser. For example logging to generate a save a kubeconfig for RBAC workflows. This seems like an automation dream for all kinds of things when I want to see browser interactions and results - but all from a terminal! This is awesome.
- j16sdiz 4y agoWhy? Microsoft's SSO solution supports kerebous, you could use that.
- niutech 4y agoDid you mean Kerberos? https://en.wikipedia.org/wiki/Kerberos_(protocol) https://en.wikipedia.org/wiki/Kerberos_(protocol)
- zimbatm 4y agoI had a dream, that one day I would be filling captchas in the terminal :-)
- rubatuga 4y agoAbsolutely insane engineering. Hope this is an alternative to elinks
- 0xfaded 4y agoI'm selfishly hoping so as well. I still occasionally use elinks to browse the web from a machine I'm SSH'd into.
- randall 4y agoThis is the coolest shit ever.
- michaelmior 4y agoI'm incredibly impressed with how smooth this is. (And how small the Docker container is!) I might actually use this for real things.
- igneo676 4y agoHuh, built on electron. I wonder how difficult it would be to bolt this onto vieb and have the ultimate vim-terminal browser
- heleninboodler 4y agoWhat does "built on electron" mean in this context?
- SeanAnderson 4y agoMy jaw is on the floor. I would've been fully impressed with the unoptimized version, but pushing it to squeak out significant rendering performance improvements was a surprise treat!
- kps 4y agoTime to dig out my Wyse 50 again! https://chromium.googlesource.com/chromium/src/+/HEAD/docs/ozone_overview.md#caca https://chromium.googlesource.com/chromium/src/+/HEAD/docs/o...
- devadvance 4y agoThanks for posting this link. I saw this submission and remembered that Chromium had a terminal rendering mode, but couldn't manage to find this page, since I wasn't searching Ozone specifically. The fork here goes even further, which is really cool.
- kps 4y ago> The fork here goes even further, which is really cool. The fork here goes incomparably further. Libcaca just produces an ‘ASCII art’ approximation of an image, not capable of handling text. So, while the photo is too small to see it, the text on the terminal is gibberish. The libcaca backend was done as an backend interoperability exercise, and run on a real terminal just for fun.
- SirRockALot 4y agoThis is really neat. Did you consider using the full range of Unicode block glyphs to squeeze out a little bit more resolution from the terminal vs just using the half-block? https://github.com/blitzcode/term-gfx/blob/master/src/main.rs#L58 https://github.com/blitzcode/term-gfx/blob/master/src/main.r... You're still just getting two colors per character, but I think it works quite nicely.
- fathyb 4y agoIt’s a great idea, I did explore it but ended up falling in the dithering and Fourier rabbit hole.. I’ll give it another try without any color tricks!
- Simran-B 4y agoThis article might be helpful with regards to dithering: https://www.zephray.me/post/grayscale_lcd/ https://www.zephray.me/post/grayscale_lcd/
- HideousKojima 4y agoI've thought about that for a GB emulator that renders to the terminal, but how do you handle more than 2 colors? That was the issue that kept me from using it.
- lights0123 4y ago> One of the unicode characters we can render is the lower half block element U+2584: . Knowing that cells generally have an aspect ratio of 1:2, we can render perfectly square pixels by setting the background color to the top pixel color, and the foregound color to the bottom pixel color. Even better: https://en.wikipedia.org/wiki/Sixel https://en.wikipedia.org/wiki/Sixel Doesn't support 24-bit color though.
- fathyb 4y agoI did write a very fast SIXEL back-end [0] with adaptative quantizing and GPU acceleration, but most emulators have a very inefficient implementation unfortunately. For example iTerm converts the SIXEL data to PNG, writes it to tmpdir, and displays it as an image you can drag and drop. I’m still exploring it thought, but as a separate program to run any X apps through SSH. [0]: https://news.ycombinator.com/item?id=34288262 https://news.ycombinator.com/item?id=34288262
- deleted 4y ago[deleted]
- david2ndaccount 4y agoThere’s also the kitty graphic protocol: https://sw.kovidgoyal.net/kitty/graphics-protocol https://sw.kovidgoyal.net/kitty/graphics-protocol
- csdvrx 4y agoNot a huge fan TBH
- david2ndaccount 4y agoWhat's wrong with it?
- csdvrx 4y ago
- ShowalkKama 4y agoReminds me of https://www.brow.sh/ https://www.brow.sh/
- capitainenemo 4y agoExactly what I was thinking. Brow.sh has been around for 5 years. I guess the difference is this one is a fork instead of a wrapper of a standard browser?
- forgotpwd16 4y agoIt's a fork in the sense that it patches Chromium. More accurately difference is in this case the rendering happens by hooking a new capture device to the graphics library utilized by Chrome whereas browsh utilizes a webext which communicates with a background process (thus theoretically* could be browser-independent but currently only supports Firefox). *Issue is Chrome doesn't support extensions in headless mode.
- niutech 4y agoThere is a workaround to headless mode with extensions - run Chrome in Xvfb and make screenshots using Chrome DevTools Protocol: `xvfb-run --server-args="-screen 0 1920x1080x24" google-chrome --remote-debugging-port=9222 --disable-gpu http://example.org http://example.org`
- spijdar 4y agoI remember trying brow.sh several years back, and thinking it was cool, and then not touching it since it was a bit too sluggish and "off" to be a practical tool for multi-media heavy sites. This might not be a fair evaluation, but that was my first impression. This project, on the other hand, allows me to "watch" Youtube videos across a fairly slow SSH connection on a remote host on the other side of NA, and "smoothly" scroll around, looking through comments and the like. Comparing them side by side, it seems like brow.sh is a bit more precise (re: layout), but carbonyl is much more responsive. Very impressive. Not sure if there's a use for watching Unicode youtube videos in the terminal, but impressive!
- dodslaser 4y agoSuper neat. If you want to go even deeper down the terminal graphics rabbit hole you should look into adding sixel support. https://github.com/saitoha/libsixel https://github.com/saitoha/libsixel
- csdvrx 4y agoAnd for terminals that don't support sixel yet, sixel-tmux will let you see them: http://github.com/csdvrx/sixel-tmux http://github.com/csdvrx/sixel-tmux For example with Windows Terminal: https://raw.githubusercontent.com/csdvrx/sixel-tmux/main/examples/sixel-tmux-inside-windows-terminal.gif https://raw.githubusercontent.com/csdvrx/sixel-tmux/main/exa... OP, if you want to keep your current solution, check how going beyond unicode halfblocks can help: https://github.com/csdvrx/derasterize https://github.com/csdvrx/derasterize
- wing-_-nuts 4y agoThis is really cool. Is it supported on the framebuffer terminal as well?
- csdvrx 4y agosixel-tmux works literally anywhere you can use tmux: as long you can display unicodes on your terminal, the sixels will be "captured" by sixel-tmux and converted into something you can see. Sixels are in-band, so ssh isn't a problem. In a way, using sixel-tmux is like "giving magical goggles" to your terminal, to let it render sixels so you can see something (even if it isn't perfect), in the hope you'll be tempted to use a better terminal that will show you sixels in all their glory, with a pixel perfect quality. Sixels enable all kind of cool things, like gnuplot right in your terminal (cf https://github.com/csdvrx/sixel-gnuplot https://github.com/csdvrx/sixel-gnuplot ): sometimes I even watch youtube on my terminal lol sixel-tmux was made as a first step towards turning derasterize into a more general library: my plan was to add it to nnn but I got bored along the way and moved to other stuff. I might still do that I I love nnn as a filemanager. BTW, even if there have been quite a few interesting work by @hpa and others in the last 2 years, I think derasterize still has textmode supremacy. derasterize is a collab with @jart after I started adding features to her previous solutions which was based on half blocks like this solution; she's also made further work based on this like https://justine.lol/printimage.html https://justine.lol/printimage.html and https://justine.lol/printvideo.html https://justine.lol/printvideo.html
- sylware 4y agoWhat we actually need would be a full-blown modern javascript-enabled browser written in simple and plain C (c89 with benign bits of c99/c11), namely with a compile-time/runtime object model suited for the "web". I good start: re-use the parsers from netsurf, get mr Bellard and friends quickJS... and then the ez part: get 748392749324732984 full-time devs full for 748937489234 centuries in order to get such engine working... BUT it is not finish since, once "working", you will have to play catch up with blackrock/vanguard financed web engines and everything they will do to break compat with your engine. Some ppl are still trying with rust? servo something?
- rightbyte 4y agoYe the problem is the web sorta standard themself. A never ending bloat race that you need 100s of programmers to keep up with. Thatcher is by design and I guess Google is mainly to blame by now.
- sylware 4y agoWell geeko/webkit and blink are all financed by the big tech controlling funds. webkit(apple) and blink(google=alphabet) are own and steered by those same ppl. Oh, and those ppl own and steer microsoft too, and some wonder why those are using blink now. I do ask myself how long they will keep webkit and blink since they have already geeko to feint the anti-trust laws. But your are right, they made the "Standard" so insanely complex on top of the core noscript/basic (x)html, that it "works" only in their implementations with their armies of devs. This is accutely toxic for humanity. The only "real" ways out of this: restore noscript/basic (x)html where it is still doing a good enough job, and if a "new" web has to be born: an implemention must be something reasonable in time/skills and efforts for a small team of devs.
- sylware 4y agoI like the terms "bloat race": this is how they "keep control" even if it is open source.
- anthk 4y agoQuickJS it's being used in the edbrowse terminal browser and it's good enough to login and post on a lot of web sites.
- anthk 4y agoMeh, electron. I'd prefer elinks being boosted with QuickJS support instead of the old engine based on... Mozilla? Edbrowse uses it and it has enough JS support to even login and comment against JS ridden sites. https://edbrowse.org https://edbrowse.org Browser, email, irc, SQL client, file manager and editor for the blind with an ed philosophy.
- wwarner 4y agoI mean. This works really really well. I almost made it through a captcha.
- comfypotato 4y agoCould probably zoom into the captcha with some elbow grease. The resolution is there if it filled the terminal. This is actually the showstopper for me with any kind of terminal browser. I enjoyed playing with browsh (or what was it called?) a few years ago, but this is much better. I wonder if my suggested workaround has any meat to it.
- oldgradstudent 4y agoNext step: vscode on the terminal.
- yuck39 4y agoInstall the VIM plugin and we go full circle
- lxe 4y agodocker run -ti fathyb/carbonyl https://vscode.dev/
- heleninboodler 4y agodocker run -ti fathyb/carbonyl https://github1s.com/fathyb/carbonyl
- fathyb 4y agoRun this command in the VSCode terminal to get VSCode rendering into Chromium rendering into VSCode rendering into Chromium.
- oldgradstudent 4y agoIt doesn't really work. But it is close enough that with some work it could.
- realworldperson 4y ago[dead]
- synergy20 4y agoxterm + w3m can browse with images for me. kitty + w3m is getting there as well.
- whatever1 4y agoNewbie question: why the terminal cannot have full high definition graphics ?
- IncRnd 4y agoTerminals started as TTY or teletype emulators. Everything else is an addon.
- deathanatos 4y agoMost emulate an xterm, which didn't have support for graphics. (And xterm itself is emulating an even older TTY … with features bolted on…) There are some escape sequences you can feed to some terminals, though, that emit graphics. "Sixels" are pretty well known for pushing graphics to a terminal, but they're not universally supported. iTerm2, on macOS, has a means of escaping and then sending a PNG, which is then displayed, IIRC. (But it's unique to iTerm2, and IIRC iTerm2 identifies as an xterm so it's basically impossible to autodetect.)
- csdvrx 4y ago> Most emulate an xterm, which didn't have support for graphics Start your xterm with the right flags and it will. If you want a premade configuration, see https://github.com/csdvrx/CuteXterm https://github.com/csdvrx/CuteXterm
- csdvrx 4y agoPro answer: yes it can! https://www.arewesixelyet.com/ https://www.arewesixelyet.com/
- michaelsbradley 4y agoIt can. See, for example, Notcurses: https://github.com/dankamongmen/notcurses#readme https://github.com/dankamongmen/notcurses#readme Demo: https://youtu.be/dcjkezf1ARY https://youtu.be/dcjkezf1ARY
- aumerle 4y agoYes it can as long as you avoid sixel and xterm. https://sw.kovidgoyal.net/kitty/graphics-protocol/ https://sw.kovidgoyal.net/kitty/graphics-protocol/
- 6502nerdface 4y agoI absolutely love how in the YouTube demo (on the github page) he makes a point of enabling 1080p playback :-)
- lxe 4y agoWow. Absolutely incredible work. Once in a while there's a rare demonstration of incredible software engineering on HN, and this is one of these times.
- mcbuilder 4y agoThis is incredible, think of the applications! Running a terminal inside a WASM VM inside a browser running from your VT100 terminal is now possible. I am literally floored, and I've been waiting for this moment for years. Thank you for coming up with this inventive solution, and I feel this will usher in a new era of "text" interfaces!
- anthk 4y agoNo, the opposite. This is half baked. Elinks having JS supports would be much better. Videos? Just spawn mpv on audio/video links or send the links thru xsel to mpv+yt-dlp.
- antongribok 4y agoI can confirm... Slack works. Sadly, still hogs way too much RAM. This is truly very impressive.
- WesolyKubeczek 4y agoBut now you can put it into tmux/screen and run it somewhere else ;)
- Scoundreller 4y agoThis is the stuff of my 2400bps dreams.
- jay-barronville 4y agoReally impressive!!!
- desi_ninja 4y agoThis is why I visit hackernews. Amazing feat
- deleted 4y ago[deleted]
- xvilka 4y agoGiven it's in Rust, I wonder if something like that could be based on top of Servo instead [1]. [1] https://github.com/servo/servo/issues/24162 https://github.com/servo/servo/issues/24162
- liamzebedee 4y agoThis is freakin' amazing! Such a glorious hack. It'd be fun to build a pure CLI-based OS around this. Imagine opening apps by running `/www/github.com`
- jaxrtech 4y agoIf NeXTStep used "Display PostScript", then what display API did the original WorldWideWeb browser render to?
- fathyb 4y agoAFAIK it used same NeXTStep Text (NSText) API [0] that is still being used on macOS nowadays [1], it didn't support rendering images at first: > The inline images such as the world/book icon and the CERN icon, would have been displayed in separate windows, as it didn't at first do inline images. Historically, DPS is one of the reasons Safari PDF exports look so good: Apple based CoreGraphics APIs on DPS to make the migration from NeXTStep to Mac OS easy. This makes the CoreGraphics<->PS/PDF conversion fairly straightforward. [0]: https://www.w3.org/People/Berners-Lee/WorldWideWeb.html https://www.w3.org/People/Berners-Lee/WorldWideWeb.html [1]: https://developer.apple.com/documentation/appkit/nstext https://developer.apple.com/documentation/appkit/nstext
- KirillPanov 4y agoThis is extremely cool. Do you plan to try to get the chromium patch upstreamed, or some subset of it? Have you had problems with this triggering bot/scraper/abuse-detection? You force-enable `kContentCapture`, `kContentCaptureTriggeringForExperiment`, and `kContentCaptureInWebLayer`, which make the browser look -- to the website -- a LOT like a bot/scraper and not at all like a normal user.
- fathyb 4y agoI plan on submitting some bug fixes, but I believe the rest will be a hard sell to the Chromium team. They also have very high standards, and the current implementation is not up to it as of today. Something that could be cool is work with them/submit patches to improve the DevTools protocol to be more efficient and suited for Carbonyl and html2svg's use-case. Combined with a virtual X server (in Rust of course!), this could provide very similar performance and remove the need to fork. For the bot-detection, I only had Twitter telling me the browser is not compatible so far, it was caused by the "Carbonyl (version)" user-agent. I fixed it by switching to "Chromium (version) / Carbonyl". Good point on kContentCapture, I didn't realize it could be visible to websites. I enabled it to experiment with new ways to get text data, but ended falling back on Skia. I'm going to disable it now that it's unused!
- nanmu42 4y agoThis is epic. From the author's Github repo: # Watch YouTube inside a Docker container $ docker run -ti fathyb/carbonyl https://youtube.com https://youtube.com
- sfmike 4y agoso the legends that pipe the web and email can now use it via GUI while remaining in the terminal?
- Zuiii 4y agoAny chance (at all) this gets merged back into upstream? This is incredibly useful and is a major improvement over elinks and friends. I really don't want to see this to fall behind upstream in terms of performance and security fixes.
- asicsp 4y agoDiscussion for the link mentioned in the opening para: "Forking Chrome to turn HTML into SVG" https://news.ycombinator.com/item?id=33584941 https://news.ycombinator.com/item?id=33584941 (471 points | 75 days ago | 97 comments)
- abdnafees 4y agoThis in nice.
- quotemstr 4y agoImpressive. I want to use this for real to render HTML email in Emacs.
- ris58h 4y agoI can't check it right now but is it possible to use Vimium with it?
- ruined 4y agoanother chromium fork?? truly we are becoming a browser monoculture
- tgv 4y agoCool, ok, and certainly a surprising hack, but what's with the gushing comments? Who wants to run Chrome in a terminal? Almost nobody, because there are dedicated, lean alternatives for browsing since the start of the web, and almost nobody uses them. Am I missing something?
- trifurcate 4y agoI would certainly run this over something like lynx. In fact, my reaction was "oh, this is what I'm looking for when I reach for lynx".
- rnk 4y agoAre you teasing us on purpose by not suggesting some well known lean alternatives? lynx comes to mind, doesn't show images, does work ok. But what are you thinking about?
- WesolyKubeczek 4y agoAlas, in 2023 most of the modern web just won’t work with Lynx. Or w3m. Or Elinks. Or it will work but in a way that makes you suffer and miss on functionality you might need. Just a consequence of turning a markup language into an OS.
- tgv 4y agoBut what's the point of using a terminal to render a website lynx and friends can't handle, when the browser is but a click away? I can imagine a scenario like this: you must use a website that can only be reached from within a certain network, and you can ssh in, but there's no X11 tunnel, and the website really requires rendering animated SVGs and Javascript. That would be a lousy design, but it might happen. But how often do you encounter that?
- austinjp 4y agoPersonally, I'm pretty sick of the bloated, image heavy, ad infested nature of the modern web. Terminal browsers promise a lighter experience focused on content rather than style.
- zx8080 4y agoSure, let's bring chromium with its resource consumption to terminal. Why not! But seriously, why not using browsers like lynx and links?
- Asdrubalini 4y agoDid you see this fork's demo and a demo of lynx/links? Their difference is day and night
- 0xcb0 4y agoThat is some really cool development! I'm curious to see an implementation adding plugin support. And maybe ultimately bringing this all inside of emacs <3
- codedeep 4y agoThis is really impressive & interesting write up
- FreeFull 4y agoWould be nice to have binaries available. Using `gclient sync` is taking ages to pull down the chromium sources for me
- greatNespresso 4y agoMind blowing, that's the kind of projects that makes me wonder what I am doing from my free time before realizing I have not even 10% of the skills and smartness required to pull out something like this. Thank you for sharing, that's really incredible!
- nirav72 4y agoI wonder what this would look like with retroterm.
- dioptre 4y agoI’d love to see vimperator support for this.