question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

chromeWebSecurity setting does not take effect in Electron browser

See original GitHub issue

Current 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",
 })

image

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:closed
  • Created 3 years ago
  • Reactions:8
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

7reactions
flotwigcommented, Aug 27, 2020

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#23664

Here is a workaround that should work based on this comment:

Set the ELECTRON_EXTRA_LAUNCH_ARGS environment variable to disable-features=OutOfBlinkCors to forcefully disable chromeWebSecurity in Cypress 5.

For example, in Linux or macOS:

ELECTRON_EXTRA_LAUNCH_ARGS=disable-features=OutOfBlinkCors cypress run ...
0reactions
cypress-bot[bot]commented, Oct 14, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found