From 34f96ae41d35ff66256cf3e0018a219aade2c95b Mon Sep 17 00:00:00 2001 From: Jeremy Rose Date: Tue, 29 Sep 2020 13:51:53 -0700 Subject: [PATCH] fix: suppress worldSafe warning emitted from security checks --- lib/renderer/security-warnings.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/renderer/security-warnings.ts b/lib/renderer/security-warnings.ts index accbbc927979b..4c5b829eeb1b7 100644 --- a/lib/renderer/security-warnings.ts +++ b/lib/renderer/security-warnings.ts @@ -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 = 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 {