Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "--proxy-bypass-list=<-loopback>" flag to default chrome args #3049

Merged
merged 9 commits into from
Jan 30, 2019
6 changes: 6 additions & 0 deletions packages/server/lib/browsers/chrome.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ utils = require("./utils")

LOAD_EXTENSION = "--load-extension="
CHROME_VERSIONS_WITH_BUGGY_ROOT_LAYER_SCROLLING = "66 67".split(" ")
MIN_CHROME_VERSION_WITH_LOOPBACK_PROXY_BYPASS_RULE = 72

pathToExtension = extension.getPathToExtension()
pathToTheme = extension.getPathToTheme()
Expand Down Expand Up @@ -147,6 +148,11 @@ module.exports = {
if majorVersion in CHROME_VERSIONS_WITH_BUGGY_ROOT_LAYER_SCROLLING
args.push("--disable-blink-features=RootLayerScrolling")

## https://chromium.googlesource.com/chromium/src/+/da790f920bbc169a6805a4fb83b4c2ab09532d91
## https://github.com/cypress-io/cypress/issues/1872
if majorVersion >= MIN_CHROME_VERSION_WITH_LOOPBACK_PROXY_BYPASS_RULE
jennifer-shehane marked this conversation as resolved.
Show resolved Hide resolved
args.push("--proxy-bypass-list=<-loopback>")

args

open: (browserName, url, options = {}, automation) ->
Expand Down
4 changes: 4 additions & 0 deletions packages/server/lib/environment.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ try
app = require("electron").app
app.commandLine.appendSwitch("disable-renderer-backgrounding", true)
app.commandLine.appendSwitch("ignore-certificate-errors", true)
## this should really only be necessary when
## running Chromium versions >= 72
## https://github.com/cypress-io/cypress/issues/1872
app.commandLine.appendSwitch("proxy-bypass-list", "<-loopback>")
jennifer-shehane marked this conversation as resolved.
Show resolved Hide resolved

if os.platform() is "linux"
app.disableHardwareAcceleration()
Expand Down
21 changes: 21 additions & 0 deletions packages/server/test/unit/browsers/chrome_spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,24 @@ describe "lib/browsers/chrome", ->
disabledRootLayerScrolling("66", true)
disabledRootLayerScrolling("67", true)
disabledRootLayerScrolling("68", false)

## https://github.com/cypress-io/cypress/issues/1872
it "adds <-loopback> proxy bypass rule in version 72+", ->
arg = "--proxy-bypass-list=<-loopback>"

disabledRootLayerScrolling = (version, bool) ->
jennifer-shehane marked this conversation as resolved.
Show resolved Hide resolved
args = chrome._getArgs({
browser: {
majorVersion: version
}
})

if bool
expect(args).to.include(arg)
else
expect(args).not.to.include(arg)

disabledRootLayerScrolling("71", false)
disabledRootLayerScrolling("72", true)
disabledRootLayerScrolling("73", true)