-
Notifications
You must be signed in to change notification settings - Fork 397
'unsafe-eval' is not an allowed source of script #733
Copy link
Copy link
Closed
Labels
Milestone
Description
| tokenized_length = new Function('element', "return (element.val().#{tokenizer} || '').length")(element) |
| fn = new Function("return #{tokenized_length} #{operator} #{options[check]}") |
Above line of codes produces error
Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive.
helpful links:-
- https://github.com/jamesallardice/jslint-error-explanations/blob/master/message-articles/function-constructor.md
- http://jslint.fantasy.codes/the-function-constructor-is-eval
Environment
- Version used: 11.1
- Browser Name and version: Google Chrome Version 64.0.3282.140 (Official Build) (64-bit)
- Operating System and version (desktop or mobile): Windows 10 Pro (64-bit)
Reactions are currently unavailable