From 2bd8877be37b35e4036ea23a3631e9a1d9159a1d Mon Sep 17 00:00:00 2001 From: Felix Rieseberg Date: Sat, 7 Oct 2017 08:26:32 -0700 Subject: [PATCH] :wrench: String comparison --- lib/renderer/init.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/renderer/init.js b/lib/renderer/init.js index cdb8849f3a09..b7fc3877ab27 100644 --- a/lib/renderer/init.js +++ b/lib/renderer/init.js @@ -129,7 +129,9 @@ if (nodeIntegration === 'true') { } } - if (/(https?)|(ftp):/.test(window.location.protocol)) { + if (window.location.protocol === 'https:' || + window.location.protocol === 'http:' || + window.location.protocol === 'ftp:') { let warning = 'This renderer process has Node.js integration enabled ' warning += 'and attempted to load remote content. This exposes users of this app to severe ' warning += 'security risks.\n'