mrmarcokiko / namebench

Automatically exported from code.google.com/p/namebench
Apache License 2.0
0 stars 0 forks source link

Mac OS X: namebench opens report with .html handler rather than default web browser #92

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
On Mac OS X namebench defaults to Firefox to display the report instead of the 
user's browser 
choice.

Namebench should query the system as to the availibility of web browsers for 
the list and choose 
select the user default.

Another option is to have the GUI open the HTML file itself using WebKit as the 
renderer.

Original issue reported on code.google.com by DreadLor...@gmail.com on 6 Jan 2010 at 9:23

GoogleCodeExporter commented 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

GoogleCodeExporter commented 8 years ago
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