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

fix: remove unsafe-eval (CSP volation) #140

Closed
wants to merge 1 commit into from
Closed

fix: remove unsafe-eval (CSP volation) #140

wants to merge 1 commit into from

Conversation

benhormann
Copy link

Eruda fails to load on sites that block eval (Function constructor).

I couldn't find a reason for this function to be using eval, so I've simplified it.
I also converted it to use ES2015 rest / spread.

The only effect of this change I found is one less line in stack trace (if contructor throws).

@codecov-io
Copy link

Codecov Report

Merging #140 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #140   +/-   ##
=======================================
  Coverage   66.78%   66.78%           
=======================================
  Files          32       32           
  Lines        2761     2761           
=======================================
  Hits         1844     1844           
  Misses        917      917           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 42dc1b9...31250c6. Read the comment docs.

surunzi added a commit that referenced this pull request May 2, 2020
@surunzi
Copy link
Member

surunzi commented May 2, 2020

util.js file can not be modified since it is generated by https://github.com/liriliri/eustia.
I've just fixed the issue, try version 2.3.3 and see if it works.

@surunzi surunzi closed this May 2, 2020
@benhormann
Copy link
Author

Thanks, is working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants