git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv2] git-web--browse: Add support for google chrome and chromium
@ 2010-05-29 18:36 Pavan Kumar Sunkara
  0 siblings, 0 replies; only message in thread
From: Pavan Kumar Sunkara @ 2010-05-29 18:36 UTC (permalink / raw)
  To: git, jnareb, chriscool, pasky; +Cc: Pavan Kumar Sunkara

Add support for google's chrome & chromium. The value of the
browser is 'chromium' or 'chrome' to select it.

You can always provide config variable for browser path if they
are not installed in right paths.

Signed-off-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
---
 git-web--browse.sh |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/git-web--browse.sh b/git-web--browse.sh
index a578c3a..dbded76 100755
--- a/git-web--browse.sh
+++ b/git-web--browse.sh
@@ -31,7 +31,7 @@ valid_custom_tool()
 
 valid_tool() {
 	case "$1" in
-		firefox | iceweasel | konqueror | w3m | links | lynx | dillo | open | start)
+		firefox | iceweasel | chrome | chromium | konqueror | w3m | links | lynx | dillo | open | start)
 			;; # happy
 		*)
 			valid_custom_tool "$1" || return 1
@@ -103,7 +103,7 @@ fi
 
 if test -z "$browser" ; then
     if test -n "$DISPLAY"; then
-	browser_candidates="firefox iceweasel konqueror w3m links lynx dillo"
+	browser_candidates="firefox iceweasel chrome chromium konqueror w3m links lynx dillo"
 	if test "$KDE_FULL_SESSION" = "true"; then
 	    browser_candidates="konqueror $browser_candidates"
 	fi
@@ -146,6 +146,11 @@ case "$browser" in
 	test "$vers" -lt 2 && NEWTAB=''
 	"$browser_path" $NEWTAB "$@" &
 	;;
+    chrome|chromium)
+	# Actual command for chromium is chromium-browser.
+	# No need to specify newTab. It's default in chromium
+	eval "$browser_path" "$@" &
+	;;
     konqueror)
 	case "$(basename "$browser_path")" in
 	    konqueror)
-- 
1.7.1.20.g1e801.dirty

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-05-29 18:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-29 18:36 [PATCHv2] git-web--browse: Add support for google chrome and chromium Pavan Kumar Sunkara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).