MCPcopy Create free account
hub / github.com/tebeka/selenium / allowProxyForLocalhost

Function allowProxyForLocalhost

remote_test.go:1812–1832  ·  view source on GitHub ↗
(browser string, caps Capabilities)

Source from the content-addressed store, hash-verified

1810}
1811
1812func allowProxyForLocalhost(browser string, caps Capabilities) {
1813 switch browser {
1814 case "firefox":
1815 // By default, Firefox explicitly does not use a proxy for connection to
1816 // localhost and 127.0.0.1. Clear this preference to reach our test proxy.
1817 ff := caps[firefox.CapabilitiesKey].(firefox.Capabilities)
1818 if ff.Prefs == nil {
1819 ff.Prefs = make(map[string]interface{})
1820 }
1821 ff.Prefs["network.proxy.no_proxies_on"] = ""
1822 ff.Prefs["network.proxy.allow_hijacking_localhost"] = true
1823 caps.AddFirefox(ff)
1824
1825 case "chrome":
1826 ch := caps[chrome.CapabilitiesKey].(chrome.Capabilities)
1827 // Allow Chrome to use the specified proxy for localhost, which is
1828 // needed for the Proxy test. https://crbug.com/899126
1829 ch.Args = append(ch.Args, "--proxy-bypass-list=<-loopback>")
1830 caps.AddChrome(ch)
1831 }
1832}
1833
1834func testSwitchFrame(t *testing.T, c config) {
1835 wd := newRemote(t, c)

Callers 1

runTestProxyFunction · 0.85

Calls 2

AddFirefoxMethod · 0.80
AddChromeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…