🔧 Add security warning
This commit is contained in:
parent
d7aa0b0ddb
commit
11ac780caf
1 changed files with 9 additions and 0 deletions
|
@ -129,6 +129,15 @@ if (nodeIntegration === 'true') {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (/(https?)|(ftp):/.test(window.location.protocol)) {
|
||||||
|
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'
|
||||||
|
warning += 'For more information and help, consult https://electron.atom.io/docs/tutorial/security/'
|
||||||
|
|
||||||
|
console.warn('%cElectron Security Warning', 'font-weight: bold;', warning)
|
||||||
|
}
|
||||||
|
|
||||||
// Redirect window.onerror to uncaughtException.
|
// Redirect window.onerror to uncaughtException.
|
||||||
window.onerror = function (message, filename, lineno, colno, error) {
|
window.onerror = function (message, filename, lineno, colno, error) {
|
||||||
if (global.process.listeners('uncaughtException').length > 0) {
|
if (global.process.listeners('uncaughtException').length > 0) {
|
||||||
|
|
Loading…
Reference in a new issue