bernigaud / googlecl

Automatically exported from code.google.com/p/googlecl
0 stars 0 forks source link

Browser launch opens new instance (Mac) #48

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Set environment variable BROWSER or config variable auth_browser to a 
browser executable on a Mac.
2. Run a service for the first time.
3. An extra copy of the browser will launch, leading to extra loading time and 
possibly errors opening in the browser.

What is the expected output? What do you see instead?
I expect the script to open a new tab or window in the current running instance

What version of the product are you using? On what operating system?
GoogleCL 0.9.5 on Mac OS X 10.6.3

Please provide any additional information below.
I've attached a patch that will use the current instance of the default web 
browser, no configuration necessary.

Original issue reported on code.google.com by impiaaa on 18 Jun 2010 at 10:08

Attachments:

GoogleCodeExporter commented 9 years ago
I just set my auth_browser to 'open', a osx command line utility to open 
arbitrary files and urls with the default application for them.

Original comment by ulrich.moritz on 18 Jun 2010 at 10:49

GoogleCodeExporter commented 9 years ago
I know about the open command, but I think using the default browser by default 
on all systems is a better idea.

Original comment by impiaaa on 19 Jun 2010 at 12:44

GoogleCodeExporter commented 9 years ago
Yet another wonderful Python module I was unaware of. I've started working in 
the use of webbrowser, and I'll attach a patch of the final changes.

Original comment by tom.h.mi...@gmail.com on 19 Jun 2010 at 7:48

GoogleCodeExporter commented 9 years ago
Here's the patch (svn diff) for googlecl.service. I kept the auth_browser 
config option in, just in case the user wants to launch a non-standard browser.

Original comment by tom.h.mi...@gmail.com on 19 Jun 2010 at 8:00

Attachments:

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r246.

Original comment by tom.h.mi...@gmail.com on 19 Jun 2010 at 8:04

GoogleCodeExporter commented 9 years ago
Here's a diff that expands on impiaaa's. It adds a fix for newer osx systems by 
bringing in a compat file from py3k. It also handles the defaults differently, 
since BROWSER is recognized by get() anyway. Therefore there is no reason to 
try and manually read it. FYI, i've only tested this once on osx, but it should 
generally work.

Original comment by dcol...@gmail.com on 20 Jun 2010 at 5:37

Attachments:

GoogleCodeExporter commented 9 years ago
The patch committed for r246 wont work with google chrome on osx. Also there is 
still no need to read the BROWSER env var manually. get() does this for you.

Original comment by dcol...@gmail.com on 20 Jun 2010 at 5:41

GoogleCodeExporter commented 9 years ago
Ok I see that get was added, but it'll error on osx. The osascript is not 
correct in that version of the webbrowser module.

Original comment by dcol...@gmail.com on 20 Jun 2010 at 5:57

GoogleCodeExporter commented 9 years ago
dcolish, I'm not sure I follow your patch. Is the compat module only available 
in py3k? What error occurs for Chrome on MacOSX with this patch?

Original comment by tom.h.mi...@gmail.com on 20 Jun 2010 at 6:49