Message243590
When calling webbrowser.open*(), the module goes through a list of installed browsers, and uses the first one that succeeds, to process the request.
The first 'browsers' in the 'X' list are 'xdg-open' and others of that ilk. The problem is that they only have one 'open' behavior - the 'new' parameter is ignored ('same window', 'new window', 'new tab').
I can get the fully supported default browser in GNOME with e.g.
def browser():
app = Gio.app_info_get_default_for_type('x-scheme-handler/https', True)
bpath = app.get_filename()
for candidate in webbrowser._tryorder:
if candidate in bpath:
return webbrowser.get(using=candidate)
return webbrowser.get()
... but this code accesses a private list.
The problems are:
1) webbrowser does not determine and return the current default browser.
2) There is no public interface for determining the current/installed browser type list.
The problem can be mitigated by resolving (1) and/or (2).
Also, the browser type list in the documentation is missing many entries.
Checked on 2.7 and 3.4. I believe this is valid across all supported versions. |
|
Date |
User |
Action |
Args |
2015-05-19 13:43:02 | daves | set | recipients:
+ daves |
2015-05-19 13:43:02 | daves | set | messageid: <1432042982.05.0.828874094042.issue24241@psf.upfronthosting.co.za> |
2015-05-19 13:43:02 | daves | link | issue24241 messages |
2015-05-19 13:43:01 | daves | create | |
|