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 configuration to customize or disable Content Security Policy #29596

Open
bukharov opened this issue May 30, 2024 · 4 comments
Open

Add configuration to customize or disable Content Security Policy #29596

bukharov opened this issue May 30, 2024 · 4 comments
Labels
type: feature New feature that does not currently exist

Comments

@bukharov
Copy link

What would you like?

In this file you have a Content Security Policy that governs the test runner (line 12):

https://github.com/cypress-io/cypress/blob/develop/packages/driver/src/util/privileged_channel.ts

We'd like to be able to disable that or add directives to the policy.

Why is this needed?

When running using ESBuilld it prevents dynamic imports from working. Some of our tests have dynamic imports. Currently everything works fine with Webpack because it bundles everything together. ESBuild does not do that, so those imports stop working. We'd like to use ESBuild instead as the rest of the repository has been migrated to Vite.

Other

No response

@jennifer-shehane jennifer-shehane added the type: feature New feature that does not currently exist label Jun 3, 2024
@jennifer-shehane
Copy link
Member

Does the experimentalCspAllowList help with your needs? https://docs.cypress.io/guides/references/experiments

@bukharov
Copy link
Author

bukharov commented Jun 3, 2024

@jennifer-shehane no, as far as i understand that is for the application under test, while the one i referenced is for the tests themselves

@bukharov
Copy link
Author

bukharov commented Jun 3, 2024

Basically we get a bunch of these 👇 for each dynamic import in the tests.
Screenshot 2024-06-03 at 5 17 11 PM

@tomatkapitalise
Copy link

Got the same issue as well, my scenario is when trying to use pdfjs-dist which requires you set workerSrc which loads a Worker script in the browser context. I'd like to use PDF.js to process a PDF.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature New feature that does not currently exist
Projects
None yet
Development

No branches or pull requests

3 participants