unsafe-eval in the jqGrid.min.js

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: "script-src 'unsafe-inline'".

I facing an error while loading jqGrid.min.js with the HTTP header, Content-Security-Policy as script-src ‘self’ ‘unsafe-inline’.

I don’t want to use ‘unsafe-eval’ in the script-src, Where jqGrid.min.js requires unsafe-eval to proceed

Seems the below functions used by js which required unsafe-eval to run
{return Function('"use strict";return ('+e+")

I’m using the latest version of js (version 4.7.8)
https://cdnjs.cloudflare.com/ajax/libs/jqgrid/5.8.5/js/jquery.jqGrid.min.js

Kindly help us!!

After giving the HTTP Header, Content-Security-Policy as script-src ‘self’ ‘unsafe-inline’ ‘unsafe-eval’ it works. But I need to remove unsafe-eval here

You can’t, you’d need to rewrite how the plugin works; it does runtime evaluation to figure out column width and apply inline styles.