Howdy!
I know it’s been a while since I posted – being selfish with all the new things I’ve been learning. I’m sorry. Today I was reminded in strong terms that sharing and giving are crucial, and without all the good stuff other people are posting on the internet, I wouldn’t know most of what I know today.
I want to talk about starting your browser from the command line, in this case I’m using Firefox on Windows. The terminal I’m using is Powershell.
For a long time, I got into the habit of starting my browser like this:
start firefox
I can open my favourite social media site from the shell like this:
start firefox twitter.com
Note that I didn’t even have to prepend the URL with http(s)://
or www
! Neat, eh?
Sometimes, when I’m really being lazy and I quickly want to jump to Google and conduct a search on “firefox command line options” from there, I just type
start firefox www.google.com/search?q=firefox+command+line+options
I know that this example is rather contrived, but if you understand the basics of HTTP/HTTPS and query strings, this should be easy to grasp.
Having done this for a while, today I decided to look at the Mozilla Developer Network (MDN) reference to see what Firefox had to offer by way of command line options.
And BOOM I hit a mother lode! So far I have only skimmed over it, but I’m astounded at the possibilities I see – this should really make for good browser automation. I wonder why I never thought of it before now.
If I find anything really useful I promise to share (this time). If you’re interested, have a look at MDN’s Firefox Command Line Options page.
I’m out!
Pingback: Using Your Browser From the Command Line - How to Code .NET