Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 760 Bytes

README.md

File metadata and controls

31 lines (22 loc) · 760 Bytes

LinkDispatch

Set LinkDispatch as your default Browser, and when you click an URL in some external application, this app will be run, and it will call a script named ~/.linkdispatch, and pass the clicked URL as the first argument.

Contents of .linkdispatch script should be like the following code:

#!/bin/bash

URL=$1

function open_url() {
  BROWSER=$1
  open "$URL" -a "$BROWSER"
}

if echo "$URL" | grep -q localhost
then
  open_url "Google Chrome"
elif echo "$URL" | grep -q mywebsite.com
then
  open_url "Google Chrome"
else
  open_url "Safari"
fi

If you want a pop menu for maunally browser selection when you click a link, you may wanna check this app:

MultiBrowser