Can I force Chrome window names to persist?

59 views Asked by At

I use a lot of different Chrome windows simultaneously for different user profiles. I use the Name Window function daily to quickly identify which user I'm trying to get to from the dock.

enter image description here

enter image description here

Often I'll accidentally close the whole window instead of one tab, and it's a huge pain to have to rename everything all over again every time I close Chrome.

I've done a ton of digging and trying different extensions to find a way to permanently assign window names to specific user profiles and have had no luck. Is there a way I can set a window name associated with a user in (their profile data?) and make it persist, even when relaunching after Chrome is closed?

1

There are 1 answers

0
Philippe On

You can use this script to start Google Chrome with Default user profile and same window name :

#!/bin/bash

osascript << EOF
set userProfile to "Default"
set urlToOpen to "http://www.google.com" -- The URL to open in Chrome

set chromePath to "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
set commandToRun to quoted form of chromePath & " --profile-directory=" & quoted form of userProfile & " " & quoted form of urlToOpen
do shell script commandToRun
delay 1
tell application "Google Chrome"
    if not (exists window 1) then
        make new window
        set URL of active tab of window 1 to urlToOpen
        delay 1
    end if
    execute front window's active tab javascript "document.title = 'Default'"
end tell
EOF