Browse Source

Backport - fix: Incorrect warnings in webviews (#12236)

* :wrench: Get correct webContents

* :wrench: Err, webPreferences
trop-devel[bot] 7 years ago
parent
commit
515fbb6fc3
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lib/renderer/security-warnings.js

+ 1 - 1
lib/renderer/security-warnings.js

@@ -84,7 +84,7 @@ const getWebPreferences = function () {
     }
 
     const { remote } = require('electron')
-    webPreferences = remote.getCurrentWindow().webContents.getWebPreferences()
+    webPreferences = remote.getCurrentWebContents().getWebPreferences()
     return webPreferences
   } catch (error) {
     return null