Comments (3)
Hey @bjarketrux 👋
@percy/dom package runs on the client's test browser when percySnapshot
is called, it requires the server which is serving the document to not send the CSP header for it to able to run.
you can verify it by doing the following
Expand
- start Percy's local server
npx percy exec:start --debug
- Runs
@percy/dom
package
eval(await (await fetch('http://localhost:5338/percy/dom.js')).text())
PercyDom.serialize()
The support for this would need to be built on the user's end by either having a proxy that drops the CSP header or whitelisting for it to run E2E
from cli.
Okay so the conclusion is wont-fix and with the following options as work around:
- Use Firefox as it ignores trusted-types for now
- Disable CSP headers on the code under test (only possible if debug environment)
- Use a proxy server which strips away the CSP header
You mention whitelisting. Does percy has a trusted type policy name we can use?
from cli.
You mention whitelisting. Does percy has a trusted type policy name we can use?
nothing that I could think of for trusted type, but say for connect-src
e.t.c we may use localhost:5338
from cli.
Related Issues (20)
- [percy:core] Error : Timed out waiting for network requests to idle HOT 1
- Percy is not running, disabling snapshot HOT 4
- Browserstack: Build not created, Error: connect ECONNREFUSED HOT 3
- Bumping to different versions [Dependabot] HOT 1
- Reference Error: Excessive alias count indicates a resource exhaustion attack in percy url yaml with 360 url items HOT 2
- [percy] ParseError: Unexpected argument 'storybook'
- Percy exec fails binding to ipv6 HOT 2
- 413 Payload Too Large
- static.ignore option doesn't work
- Using PERCY_ENABLE can lead to NPE HOT 4
- V1.28.2 introduces a bug causing our CI to fail due to bad requests HOT 3
- Base64 encoded SVGs cause error when capturing HOT 5
- Add `percy exec` flag to avoid failure for Percy-related issues HOT 2
- Add a command that takes screenshots and writes them to a file instead of uploading HOT 1
- Percy does not work with Yarn PnP HOT 1
- `POST /percy/snapshot` API - Error during asset discovery not reported HOT 8
- Percy Build Wait command exiting immediately on changes. HOT 3
- Cypress Tests Failing Due to DOM Serialization Error in Percy Integration
- Unable to capture the dialog web component when it is nested inside a shadow DOM HOT 5
- Percy reports "Invalid snapshot options:" even when there is zero problems HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cli.