fix: extra space in security warning message causing list misalignment (#18815)

This commit is contained in:
Jerry Wu 2019-06-18 09:59:02 -07:00 committed by Jeremy Apthorp
parent 3f7cce6d8c
commit d5811607eb

View file

@ -75,7 +75,7 @@ const isUnsafeEvalEnabled = function () {
} }
const moreInformation = `\nFor more information and help, consult const moreInformation = `\nFor more information and help, consult
https://electronjs.org/docs/tutorial/security.\n This warning will not show up https://electronjs.org/docs/tutorial/security.\nThis warning will not show up
once the app is packaged.` once the app is packaged.`
/** /**
@ -101,8 +101,8 @@ const warnAboutInsecureResources = function () {
const warning = `This renderer process loads resources using insecure const warning = `This renderer process loads resources using insecure
protocols. This exposes users of this app to unnecessary security risks. protocols. This exposes users of this app to unnecessary security risks.
Consider loading the following resources over HTTPS or FTPS. \n ${resources} Consider loading the following resources over HTTPS or FTPS. \n${resources}
\n ${moreInformation}` \n${moreInformation}`
console.warn('%cElectron Security Warning (Insecure Resources)', console.warn('%cElectron Security Warning (Insecure Resources)',
'font-weight: bold;', warning) 'font-weight: bold;', warning)
@ -120,7 +120,7 @@ const warnAboutNodeWithRemoteContent = function (nodeIntegration: boolean) {
if (getIsRemoteProtocol()) { if (getIsRemoteProtocol()) {
const warning = `This renderer process has Node.js integration enabled const warning = `This renderer process has Node.js integration enabled
and attempted to load remote content from '${window.location}'. This and attempted to load remote content from '${window.location}'. This
exposes users of this app to severe security risks.\n ${moreInformation}` exposes users of this app to severe security risks.\n${moreInformation}`
console.warn('%cElectron Security Warning (Node.js Integration with Remote Content)', console.warn('%cElectron Security Warning (Node.js Integration with Remote Content)',
'font-weight: bold;', warning) 'font-weight: bold;', warning)
@ -142,7 +142,7 @@ const warnAboutDisabledWebSecurity = function (webPreferences?: Electron.WebPref
if (!webPreferences || webPreferences.webSecurity !== false) return if (!webPreferences || webPreferences.webSecurity !== false) return
const warning = `This renderer process has "webSecurity" disabled. This const warning = `This renderer process has "webSecurity" disabled. This
exposes users of this app to severe security risks.\n ${moreInformation}` exposes users of this app to severe security risks.\n${moreInformation}`
console.warn('%cElectron Security Warning (Disabled webSecurity)', console.warn('%cElectron Security Warning (Disabled webSecurity)',
'font-weight: bold;', warning) 'font-weight: bold;', warning)
@ -160,7 +160,7 @@ const warnAboutInsecureCSP = function () {
const warning = `This renderer process has either no Content Security const warning = `This renderer process has either no Content Security
Policy set or a policy with "unsafe-eval" enabled. This exposes users of Policy set or a policy with "unsafe-eval" enabled. This exposes users of
this app to unnecessary security risks.\n ${moreInformation}` this app to unnecessary security risks.\n${moreInformation}`
console.warn('%cElectron Security Warning (Insecure Content-Security-Policy)', console.warn('%cElectron Security Warning (Insecure Content-Security-Policy)',
'font-weight: bold;', warning) 'font-weight: bold;', warning)
@ -195,7 +195,7 @@ const warnAboutExperimentalFeatures = function (webPreferences?: Electron.WebPre
const warning = `This renderer process has "experimentalFeatures" enabled. const warning = `This renderer process has "experimentalFeatures" enabled.
This exposes users of this app to some security risk. If you do not need This exposes users of this app to some security risk. If you do not need
this feature, you should disable it.\n ${moreInformation}` this feature, you should disable it.\n${moreInformation}`
console.warn('%cElectron Security Warning (experimentalFeatures)', console.warn('%cElectron Security Warning (experimentalFeatures)',
'font-weight: bold;', warning) 'font-weight: bold;', warning)
@ -215,7 +215,7 @@ const warnAboutEnableBlinkFeatures = function (webPreferences?: Electron.WebPref
const warning = `This renderer process has additional "enableBlinkFeatures" const warning = `This renderer process has additional "enableBlinkFeatures"
enabled. This exposes users of this app to some security risk. If you do not enabled. This exposes users of this app to some security risk. If you do not
need this feature, you should disable it.\n ${moreInformation}` need this feature, you should disable it.\n${moreInformation}`
console.warn('%cElectron Security Warning (enableBlinkFeatures)', console.warn('%cElectron Security Warning (enableBlinkFeatures)',
'font-weight: bold;', warning) 'font-weight: bold;', warning)
@ -259,7 +259,7 @@ const warnAboutRemoteModuleWithRemoteContent = function (webPreferences?: Electr
if (getIsRemoteProtocol()) { if (getIsRemoteProtocol()) {
const warning = `This renderer process has "enableRemoteModule" enabled const warning = `This renderer process has "enableRemoteModule" enabled
and attempted to load remote content from '${window.location}'. This and attempted to load remote content from '${window.location}'. This
exposes users of this app to unnecessary security risks.\n ${moreInformation}` exposes users of this app to unnecessary security risks.\n${moreInformation}`
console.warn('%cElectron Security Warning (enableRemoteModule)', console.warn('%cElectron Security Warning (enableRemoteModule)',
'font-weight: bold;', warning) 'font-weight: bold;', warning)