#!/bin/sh

# Because Chrome
frontmost() {
osascript <<EOF
tell application "System Events"
  set frontApp to name of first application process whose frontmost is true
end tell
EOF
}

before=$(frontmost)
open -g "$1"
sleep 0.1
after=$(frontmost)

if [ "$before" != "$after" ]; then
  open -a "$before"
fi

#!/bin/sh

open -g "$1"

Revert "Fuck you google chrome"
Revert "Fuck you google chrome"

This reverts commit fea352cfbf274921bfaf18eeda9b5c40db7ef747.

This bug seems to have been fixed in Chrome
