From c6d29c24201295b9f92777cc1c6dc29f2e0b91e9 Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Mon, 8 Jan 2024 10:45:28 -0600 Subject: [PATCH] Remove warning related to 10+ year old vm compability setup --- app/static/index.js | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/app/static/index.js b/app/static/index.js index d9af5f5f5..cd99d8bba 100644 --- a/app/static/index.js +++ b/app/static/index.js @@ -1,5 +1,5 @@ -window.eval = global.eval = function () { - throw new Error('Sorry, N1 does not support window.eval() for security reasons.'); +window.eval = global.eval = function() { + throw new Error('Sorry, Mailspring does not support window.eval() for security reasons.'); }; var util = null; @@ -27,7 +27,11 @@ function handleSetupError(error) { } function copyEnvFromMainProcess() { - const newEnv = Object.assign({}, process.env, JSON.parse(JSON.stringify(require('@electron/remote').process.env))); + const newEnv = Object.assign( + {}, + process.env, + JSON.parse(JSON.stringify(require('@electron/remote').process.env)) + ); process.env = newEnv; } @@ -41,19 +45,10 @@ function setupWindow(loadSettings) { var CompileCache = require('../src/compile-cache'); CompileCache.setHomeDirectory(loadSettings.configDirPath); - setupVmCompatibility(); - require(loadSettings.bootstrapScript); } -function setupVmCompatibility() { - var vm = require('vm'); - if (!vm.Script.createContext) { - vm.Script.createContext = vm.createContext; - } -} - -window.onload = function () { +window.onload = function() { try { var startTime = Date.now();