chromeWebSecurity setting does not take effect in Electron browser
See original GitHub issueCurrent behavior:
I make get request to external url.
.route(/documents\/9\/embed_url/, {
url:
"https://casefleet-cypress-fixtures.s3.amazonaws.com/document-viewer/between/4pages/0.html",
})
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
Issue Analytics
- State:
- Created 3 years ago
- Reactions:8
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Web Security - Cypress Documentation
Disabling web security is only supported in Chrome-based browsers. Settings in chromeWebSecurity will have no effect in other browsers. We will log a...
Read more >Disable web security in Cypress just for one test - Stack Overflow
After I saw DurkoMatKo's comment I managed to find an URL to test this 'chromeWebSecurity' option. It did not work as expected. I...
Read more >cypress-io/cypress - Gitter
Hello, I am getting the following error (both in the bundled Electron browser and Chrom 73) with Cypress 3.2.0 and don't understand why...
Read more >Web Security - Cypress - w3resource
Disabling of web security is only supported in Chrome-based browsers. Settings in chromeWebSecurity has no effect in other browsers. Cypress ...
Read more >Configuring Cypress to work with iFrames & cross-origin sites.
"chromeWebSecurity": false }. If you set it in your base cypress.json , then you will apply this to all your sites, which may...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, it seems like there is an open bug in Electron 9.x (which we upgraded to in Cypress 5) with disabling
webSecurity
: electron/electron#23664Here is a workaround that should work based on this comment:
Set the
ELECTRON_EXTRA_LAUNCH_ARGS
environment variable todisable-features=OutOfBlinkCors
to forcefully disablechromeWebSecurity
in Cypress 5.For example, in Linux or macOS:
Released in
5.4.0
.This comment thread has been locked. If you are still experiencing this issue after upgrading to Cypress v5.4.0, please open a new issue.