def maybe_open_browser():
    if config.get_option('server.headless'):
        return
    if server.browser_is_connected:
        return
    if config.is_manually_set('browser.serverAddress'):
        addr = config.get_option('browser.serverAddress')
    elif config.is_manually_set('server.address'):
        if server_address_is_unix_socket():
            return
        addr = config.get_option('server.address')
    else:
        addr = 'localhost'
    util.open_browser(Report.get_url(addr))
def maybe_open_browser():
    if config.get_option('server.headless'):
        return
    if server.browser_is_connected:
        return
    if config.is_manually_set('browser.serverAddress'):
        addr = config.get_option('browser.serverAddress')
    elif config.is_manually_set('server.address'):
        if server_address_is_unix_socket():
            return
        addr = config.get_option('server.address')
    else:
        addr = 'localhost'
    util.open_browser(Report.get_url(addr))