fix: suppress worldSafe warning emitted from security checks (#25692)

This commit is contained in:
Jeremy Rose 2020-10-01 08:59:52 -07:00 committed by GitHub
parent e2132acc5c
commit 822b044068
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -76,8 +76,9 @@ const isLocalhost = function () {
*
* @returns {boolean} Is a CSP with `unsafe-eval` set?
*/
const isUnsafeEvalEnabled = function () {
return webFrame.executeJavaScript(`(${(() => {
const isUnsafeEvalEnabled: () => Promise<boolean> = function () {
// Call _executeJavaScript to bypass the world-safe deprecation warning
return (webFrame as any)._executeJavaScript(`(${(() => {
try {
new Function(''); // eslint-disable-line no-new,no-new-func
} catch {