This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author daves
Recipients daves
Date 2015-05-19.13:43:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1432042982.05.0.828874094042.issue24241@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2015-05-19 13:43:02davessetrecipients: + daves
2015-05-19 13:43:02davessetmessageid: <1432042982.05.0.828874094042.issue24241@psf.upfronthosting.co.za>
2015-05-19 13:43:02daveslinkissue24241 messages
2015-05-19 13:43:01davescreate