s/global/session
This commit is contained in:
Родитель
3b80ee0655
Коммит
d2707315e6
|
@ -67,7 +67,7 @@ electron.ipcRenderer.on('ELECTRON_INTERNAL_RENDERER_ASYNC_WEB_FRAME_METHOD', (ev
|
|||
let nodeIntegration = 'false'
|
||||
let webviewTag = 'false'
|
||||
let preloadScript = null
|
||||
const globalPreloadScripts = []
|
||||
const sessionPreloadScripts = []
|
||||
let isBackgroundPage = false
|
||||
let appPath = null
|
||||
for (let arg of process.argv) {
|
||||
|
@ -88,7 +88,7 @@ for (let arg of process.argv) {
|
|||
} else if (arg.indexOf('--webview-tag=') === 0) {
|
||||
webviewTag = arg.substr(arg.indexOf('=') + 1)
|
||||
} else if (arg.indexOf('--global-preload') === 0) {
|
||||
globalPreloadScripts.push(arg.substr(arg.indexOf('=') + 1))
|
||||
sessionPreloadScripts.push(arg.substr(arg.indexOf('=') + 1))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -174,11 +174,11 @@ if (nodeIntegration === 'true') {
|
|||
})
|
||||
}
|
||||
|
||||
for (const globalPreloadScript of globalPreloadScripts) {
|
||||
for (const sessionPreloadScript of sessionPreloadScripts) {
|
||||
try {
|
||||
require(globalPreloadScript)
|
||||
require(sessionPreloadScript)
|
||||
} catch (error) {
|
||||
console.error('Unable to load global preload script: ' + globalPreloadScript)
|
||||
console.error('Unable to load session preload script: ' + sessionPreloadScript)
|
||||
console.error(error.stack || error.message)
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче