
work-on.sh BNR to create a new browser session in a directory called BNR. cd Browsers/įrom here you will execute the work-on-sh script. Next, change into the Browsers directory. In this example, you’ll clone the repository to a directory called Browsers. In your terminal, clone the BNR-Developer-Sandbox/BNR-blog-chrome-management git repository and specify the directory name where you’d like to save your browser sessions. $ to restore this session." įinally, the script will exit with the exit code returned by Google Chrome. # Create working directory and error log if neededĮcho "Google Chrome error log at. WORKING_ON=$1 # get directory name from first command line argument Here’s where I landed on the script: #!/bin/bash The code for this script is available on GitHub at BNR-Developer-Sandbox/BNR-blog-chrome-management. My goal was to be able to start, save, and restore named browser sessions that were easy to find. This challenge led me to explore options on how to start Google Chrome from the command line on my Mac. As the number of browser windows grew, it became hard to find the window or group of windows I needed when I needed them.

Sometimes a group of windows represented a unit of work. Each browser window represented some unit of work I was working on. I found myself with multiple browser windows open, each with multiple tabs open. Tab groups can also be expanded or collapsed as you work on different groups of tabs throughout the day.Ĭontinue reading if you’d like to learn how to further organize your workflow with separate browser sessions that you can close and restore using a shell script from the command line.Īt Big Nerd Ranch I often find myself working on multiple tasks throughout the week. How I finally closed my Google Chrome browser windows on my Macĭo you use Google Chrome on a Mac? Do you ever find yourself with multiple browser tabs open? Or multiple browser windows each with multiple tabs open? Do you ever wish you could close a particular browser window or group of browser windows and restore them later?įeatures like Google Chrome’s tab groups allow you to organize your tabs within a window.
