Browse Source

:wrench: String comparison

Felix Rieseberg 7 years ago
parent
commit
2bd8877be3
1 changed files with 3 additions and 1 deletions
  1. 3 1
      lib/renderer/init.js

+ 3 - 1
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'