Skip to content

Commit

Permalink
fix: suppress worldSafe warning emitted from security checks (#25827)
Browse files Browse the repository at this point in the history
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
  • Loading branch information
trop[bot] and nornagon committed Oct 9, 2020
1 parent 88af747 commit 56a764d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/renderer/security-warnings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 56a764d

Please sign in to comment.