Skip to content

Commit

Permalink
add chrome support
Browse files Browse the repository at this point in the history
  • Loading branch information
adam committed Jun 14, 2010
1 parent c848b6b commit 7440a39
Showing 1 changed file with 32 additions and 19 deletions.
51 changes: 32 additions & 19 deletions bin/url_handler.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,30 @@ fi

shift

firefox_handler () {
ff_version="`firefox -version`"
echo "ff_version $ff_version"
case "$ff_version" in
*1.5.0.8)
# tested on FC6
firefox -remote "openURL($url,new-tab)" && exit 0 ;;
*1.5.0.*)
firefox "$url" & exit 0 ;;
*2.0*)
firefox -new-tab "$url" && exit 0 ;;
*)
# unset of DESKTOP_STARTUP_ID needed for
# launching browser tabs within skype - go
# figure...
DESKTOP_STARTUP_ID= firefox -remote "openURL($url,new-tab)" && exit 0 ;;
esac
}

chrome_handler () {
wmctrl -a chrome
google-chrome "$1"
}

case "$method" in
ftp)
ftp=ftp
Expand All @@ -89,27 +113,16 @@ case "$method" in
;;
file|http|https|gopher)
if test -n "$DISPLAY"; then
if type -p google-chrome >& /dev/null; then
chrome_handler "$url" && exit 0
fi
if type -p firefox >& /dev/null; then
ff_version="`firefox -version`"
echo "ff_version $ff_version"
case "$ff_version" in
*1.5.0.8)
# tested on FC6
firefox -remote "openURL($url,new-tab)" && exit 0 ;;
*1.5.0.*)
firefox "$url" & exit 0 ;;
*2.0*)
firefox -new-tab "$url" && exit 0 ;;
*)
# unset of DESKTOP_STARTUP_ID needed for
# launching browser tabs within skype - go
# figure...
DESKTOP_STARTUP_ID= firefox -remote "openURL($url,new-tab)" && exit 0 ;;
esac
elif type -p mozilla >& /dev/null; then
# FIXME - which mozilla versions?
mozilla -remote "openURL($url,new-tab)" && exit 0
firefox_handler "$url" && exit 0
fi
# if type -p mozilla >& /dev/null; then
# # FIXME - which mozilla versions?
# mozilla -remote "openURL($url,new-tab)" && exit 0
# fi
fi
type -p links >& /dev/null && links "$url" && exit 0
type -p w3m >& /dev/null && w3m "$url" && exit 0
Expand Down

0 comments on commit 7440a39

Please sign in to comment.