def _local_browser_class(browser_name):

    # Log name of local browser
    LOGGER.info("Using local browser: %s [Default is firefox]", browser_name)

    # Get class of local browser based on name
    browser_class = BROWSERS.get(browser_name)
    if browser_class is None:
        raise BrowserConfigError(
            "Invalid browser name {name}.  Options are: {options}".format(
                name=browser_name, options=", ".join(BROWSERS.keys())))
    else:
        if browser_name == 'firefox':
            firefox_profile = webdriver.FirefoxProfile()

            # Bypasses the security prompt displayed by the browser when it attempts to
            # access a media device (e.g., a webcam)
            firefox_profile.set_preference('media.navigator.permission.disabled', True)

            # Disable the initial url fetch to 'learn more' from mozilla (so you don't have to
            # be online to run bok-choy on firefox)
            firefox_profile.set_preference('browser.startup.homepage', 'about:blank')
            firefox_profile.set_preference('startup.homepage_welcome_url', 'about:blank')
            firefox_profile.set_preference('startup.homepage_welcome_url.additional', 'about:blank')

            browser_args = []
            browser_kwargs = {
                'firefox_profile': firefox_profile,
            }
            if os.environ.get('SELENIUM_FIREFOX_PATH', None):
                binary_kwarg = {
                    'firefox_binary': FirefoxBinary(firefox_path=os.environ.get('SELENIUM_FIREFOX_PATH'))
                }
                browser_kwargs.update(binary_kwarg)

        elif browser_name == 'chrome':
            chrome_options = Options()

            # Emulate webcam and microphone for testing purposes
            chrome_options.add_argument('--use-fake-device-for-media-stream')

            # Bypasses the security prompt displayed by the browser when it attempts to
            # access a media device (e.g., a webcam)
            chrome_options.add_argument('--use-fake-ui-for-media-stream')

            browser_args = []
            browser_kwargs = {
                'chrome_options': chrome_options,
            }
        else:
            browser_args, browser_kwargs = [], {}

        return browser_class, browser_args, browser_kwargs
Returns class, kwargs, and args needed to instantiate the local browser.
dataset/ETHPy150Open edx/bok-choy/bok_choy/browser.py/_local_browser_class