def get_firefox_exe():
    paths = []

    # Collect possible locations
    if sys.platform.startswith('win'):
        for basepath in ('C:\\Program Files\\', 'C:\\Program Files (x86)\\'):
            paths.append(basepath + 'Mozilla Firefox\\firefox.exe')
            paths.append(basepath + 'Mozilla\\Firefox\\firefox.exe')
            paths.append(basepath + 'Firefox\\firefox.exe')
    elif sys.platform.startswith('linux'):
        paths.append('/usr/lib/firefox/firefox')
        paths.append('/usr/lib64/firefox/firefox')
        paths.append('/usr/lib/iceweasel/iceweasel')
        paths.append('/usr/lib64/iceweasel/iceweasel')
    elif sys.platform.startswith('darwin'):
        paths.append('/Applications/Firefox.app/Contents/MacOS/firefox')

    # Try location until we find one that exists
    for path in paths:
        if op.isfile(path):
            return path
    else:
        return None
Get the path of the Firefox executable
dataset/ETHPy150Open zoofIO/flexx/flexx/webruntime/xul.py/get_firefox_exe