 Today we're looking at JavaScript in the shell. I'm not talking no JS and I'm not talking about scripting using something like PhantomJS which both those things are great for their users, but we're talking about actually web browsing in your shell with JavaScript There are plenty of shell web browsers out there links E links W3M amongst others But the problem a lot of them is that they don't support JavaScript and if they do it's usually minimal Most the web uses JavaScript whether you like it or not So today we're gonna look at an option that allows us to do that Let's look at it and then talk about why you might want to use this as I'm clicking record here I'm realizing I'm not really sure how you say something I'm assuming a brush, but it's browser for your shell It's a modern text-based browser now What exactly is the how exactly this work? They have a little preview here where you're watching a YouTube? Video in your shell does it really work like this actually it does it works halfway decent for what it's for in most cases You're probably not going to use this, but there are some case scenarios where it is useful I would not think of this as a lightweight browser like you would think of Like e-links or links, you know other shell-based browsers because this actually runs Firefox headless in the background, but then basically takes ASCII screen grabs of it and displays it in your shell So It's not lightweight So you might be thinking why why would you use this and we'll get to that But let's look at how to install it so right here You can grab just a binary leak release which is around seven megabytes or you can grab the Docker one that's 230 megabytes, which probably has Firefox and all that in it I don't know why you would do that in most cases I would just go grab the release when I came in here. I great. I just found my Linux AMD64 grab the executable and went there's also a dead package in here Which will probably install dependencies if you don't have them But since I already have a basic system with Firefox installed I just needed the executable. I downloaded it and I put it in my path directory Let's go ahead and see it in action. So once I have it set up And it's gonna run that executable give it a URL, you know what for comparison. Let's Open up my website Filmsbychrist.com So this is what my website looks like right now and you can see it's scrolled We have search here where I can take in something like Linux and it's going to search using guys spell things right though and it uses JavaScript for all that the scrolling and The search there and loading the default images. So let's go into the shell and run this Give it a second. It's loading Firefox and here is my website It even loads up the ad now. I haven't tried this, but I guess if you have Plugins or an extension extensions installed in Firefox, they will activate here just like in my browser here I'm running brave which has an ad blocker so it blocks that ad the ad there does show up You come down here and you can see the videos I can click inside the search bar here and I can type in links and it doesn't work super fast here But give it a moment and it will load up the names and give another moment and it will load up the images So basically it's loading all these thumbnails that's going to convert to ASCII I would think it would work a little bit faster than this But it does work and then once they are loaded. I can click on one of them to go to that So that's how that works Let's go back to their github page and actually Let's go Here I meant to go Here and we are going to look at Usage documents, which will actually bring us to their website and I'm going to go to key bindings because it's going to be kind of important So you can see here. There's a few simple key bindings Scrolling you want to go back in history is backspace focus on the URL about bar is control L Which is normal in most browsers control Q will quit you out of it You can do control W to close a tab control T to open a new tab control R to reload and then cycle through your tabs It's actually control backslash, so let's go in here and I'll control T open up new bar I'll just type in Google calm And let's see if that loads There we go. Here's Google and again, I didn't click on everything so like I can click on About and it should open up there about yep. It's loading. It says down here at the bottom and there we go again It's not it's not very light. It's not super fast but it is usable and Let's talk about Why you might use this and why I ended up looking at the other day to solve a problem So everybody has different scenarios and this might be something that's useful for you in most cases I don't think it's super useful, but it did save me the other day I was out and about I was not at my house and There was a problem with my network It was just running really really slow and I do a lot of stuff off my servers here So I need to restart my router which would require me to log into the web interface on my local network I don't have it opened up. You can open up your router's Configurations the whole world but probably not the best idea so for me to access the configuration for my router I have to be on my local network and one thing I could have done and something I probably have done in the past for this exact scenario is you can use SSH and tunnel through Using socks so when you're browsing through your web, it's going through your your network at home But I didn't want to go through all it's not that hard to set It's just a SSH command going into your browser configuration say look at this port for socks But I didn't want to do that was like how can I use my shell? I can just SSH in to my computer here at home and access the web browser and of course I could also do another option would be SSH and Using X forwarding, but I just wanted to do it in the shell So I was able to just download this binary to my server here at home I started up pointing it at the router logged in And it's a very simple interface, but it does require a JavaScript I just logged in click the restart button right in the shell and Restarted and a little bit later my network was back up and running. So that's that's what I used it for I needed to access a Web site with JavaScript through SSH I didn't want to do any socks forwarding or X forwarding and just do it in the shell and this accomplished for me So although it may not be something I use regularly I'm glad that I have I know about it and that I have it installed and even if I didn't it's only a Three to seven megabyte download seven megabytes for the binary three for the dead which might install some other dependencies But I hope you find this useful and maybe it will get you out of a jam like it got me have a jam Or maybe you have other uses for it. Let me know if you've used it Let me know if you try it after watching this video Let me know why you used it and what you thought comment below filmsbychrist.com. Have a great day