Last active
January 11, 2018 21:21
-
-
Save bobsilverberg/3ba73200d914990a058113f762ba71b6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const PROXY_PREFS_TO_PROPERTIES_MAP = new Map([ | |
["network.proxy.autoconfig_url", "automaticProxyConfigUrl"], | |
["signon.autologin.proxy", "autoLogin"], | |
["network.proxy.socks_remote_dns", "proxyDNSForSocks5"], | |
]); | |
const getProxyPref = propertyName => { | |
return Array.from( | |
PROXY_PREFS_TO_PROPERTIES_MAP.entries()).find(entry => entry[1] === propertyName)[0]; | |
}; | |
// Get propertyName for pref: | |
PROXY_PREFS_TO_PROPERTIES_MAP.get(prefName); | |
// Get pref for propertyName: | |
getProxyPref(propertyName); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment