I would like to set some Chrome policies listed here using Selenium. My problem here is that I don't know how to map the Chromium policy names to the preference names to pass to the Chrome driver in Selenium.
Based on this question, the policy SafeBrowsingEnabled becomes:
from selenium.webdriver.chrome.options import Options as ChromeOptions
chrome_options = ChromeOptions()
chrome_options.add_experimental_option(
'prefs', {
'safebrowsing.enabled': 'false'
}
)
Based on this question, the policy DownloadRestrictions becomes:
from selenium.webdriver.chrome.options import Options as ChromeOptions
chrome_options = ChromeOptions()
chrome_options.add_experimental_option(
'prefs', {
'download_restrictions': 3
}
)
Based on this question, the policy DefaultDownloadDirectory becomes:
from selenium.webdriver.chrome.options import Options as ChromeOptions
chrome_options = ChromeOptions()
chrome_options.add_experimental_option(
'prefs', {
'download.default_directory': '/path/to/folder',
}
)
But where are these mappings coming from? I was unable to find any documentation about this.