Open GoogleCodeExporter opened 8 years ago
Interesting - I looked into what the python webbrowser library was actually
doing,
and it's just executing the following:
osascript -e 'open location "file:///Users/tstromberg/Downloads/namebench.html"'
Mac OS X, like Windows, interprets this in such a way that it uses the program
associated to .html files rather than the preferred web browser. This is the
first
time I've heard the complaint on Mac OS X, so I believe that the two are
usually the
same program.
I'm not sure of the best practices way to determine and talk to the default web
browser through Python is, but I know you can find it from Perl:
perl -MMac::InternetConfig -le '$x = (GetICHelper("http"))[1]; print $x;'
And then use some applescript to launch and control it from there. It's evil,
but I
agree that it is a problem. Thanks for the heads up!
Original comment by thomas.r...@gmail.com
on 6 Jan 2010 at 9:47
Why not just have the Cocoa GUI get the default handler and pass that to the
python script? Or how about when
the script is done it returns the file to the GUI to handle it?
Also, the default HTML handler is the default web browser in Mac OS X. Changing
the browser also automatically
changes the default file handler as well.
Original comment by DreadLor...@gmail.com
on 6 Jan 2010 at 11:34
Original issue reported on code.google.com by
DreadLor...@gmail.com
on 6 Jan 2010 at 9:23