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

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
This commit is contained in:
trop[bot]
2020-10-08 20:20:09 -07:00
committed by GitHub
parent 88af747a5b
commit 56a764d510

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 {