From 660a5ea29de7919d2bd62545b7f36a8b7bc216c3 Mon Sep 17 00:00:00 2001 From: Yawar Amin Date: Sat, 23 Oct 2010 21:08:23 -0400 Subject: Support FF3 and Google Chrome on Mac Modify cookie getter functions to find the directories where the browser cookies are stored on Mac OS X. Applied with minor changes. See also: http://www.chromium.org/user-experience/user-data-directory https://bugzilla.gnome.org/show_bug.cgi?id=738337 --- git-bz | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/git-bz b/git-bz index b558f96..7b0fe69 100755 --- a/git-bz +++ b/git-bz @@ -620,7 +620,10 @@ def get_cookies_from_sqlite_xulrunner(host, cookies_sqlite, name): "select name,value,path,expiry from moz_cookies where host in (:host, '.'||:host)") def get_bugzilla_cookies_ff3(host): - profiles_dir = os.path.expanduser('~/.mozilla/firefox') + if os.uname()[0] == 'Darwin': + profiles_dir = os.path.expanduser('~/Library/Application Support/Firefox') + else: + profiles_dir = os.path.expanduser('~/.mozilla/firefox') profile_path = None cp = RawConfigParser() @@ -678,14 +681,22 @@ def get_bugzilla_cookies_chr(host, browser, config_dir): chromium_time=True) def get_bugzilla_cookies_chromium(host): + if os.uname()[0] == 'Darwin': + config_dir = '~/Library/Application Support/Chromium/Default' + else: + config_dir = '~/.config/chromium/Default' return get_bugzilla_cookies_chr(host, "Chromium", - '~/.config/chromium/Default') + config_dir) def get_bugzilla_cookies_google_chrome(host): + if os.uname()[0] == 'Darwin': + config_dir = '~/Library/Application Support/Google/Chrome/Default' + else: + config_dir = '~/.config/google-chrome/Default' return get_bugzilla_cookies_chr(host, "Google Chrome", - '~/.config/google-chrome/Default') + config_dir) browsers = { 'firefox3' : get_bugzilla_cookies_ff3, 'epiphany' : get_bugzilla_cookies_epy, -- cgit