Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: replace eval with globalThis to comply with CSP policies
**Issue:** Sandpack currently uses `eval` to obtain the global object, which triggers CSP `unsafe-eval` violations. This poses security risks and limits the ability to use Sandpack in environments with strict CSP policies. **Solution:** Replaced the `eval`-based approach with an IIFE that sequentially checks for `globalThis`, `self`, `window`, and `global` to securely access the global object without violating CSP policies. **Testing:** - Tested in a local development environment with CSP enforced to ensure no violations occur. **Related Issue:** - [1221](#1221)
- Loading branch information