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
chromeWebSecurity setting does not take effect in Electron browser #8399
Comments
@AleksandrBorovkov Any reason you think this is due to the Electron upgrade specifically? Does this error only happen in Electron? It doesn't happen in Chrome or Firefox? Unfortunately we'll have to close this issue if there is not enough information to reproduce the problem. This does not mean that your issue is not happening - it just means that we do not have a path to move forward. Is there any way to provide a reproducible example? |
My issue is similar to #8412 |
Yes, it seems like there is an open bug in Electron 9.x (which we upgraded to in Cypress 5) with disabling Here is a workaround that should work based on this comment: Set the For example, in Linux or macOS:
|
Yeah we're getting the same issue as of Cypress 5.0 with Headless Electron, which seemingly worked fine before we upgraded. Here's a log of my browser options:
We're making a request to a service outside of the baseURL and can easily reproduce this issue with Cypress 5.0 Switching to Chrome and adding --browser chrome --headless to the Cypress run script works and we can effectively bypass CORS issues as chromeWebSecurity is set to false. However, we're stuck with Electron for the time being and this issue is somewhat blocking us unless we decide to revert. I have tried your suggestions @flotwig but it doesn't do the trick, it might just be me not setting it correctly, I have set the env var in my shell, on my machine and even added to the cypress run script yet I can't get the "workaround" to work. Here's the run script:
Anything else I should try or amend? |
@AhmedAlsaab it should be an OS environment variable, not a macOS/Linux:
If you're on Windows, you can
|
Awesome that did the trick and is a feasible workaround for us! Thanks @flotwig |
The code for this is done in cypress-io/cypress#8406, but has yet to be released. |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Current behavior:
I make get request to external url.
In Cypress 5.0 I've got error that request blocked by CORS policy.
Desired behavior:
In previous Cypress version 4.12.1 it worked without error.
I think it can be result of updating electron from 8.3.1 to 9.0.5
Versions
Cypress 5.0
Electron
The text was updated successfully, but these errors were encountered: