mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
Avoid adding a new option to webPreferences
This commit is contained in:
@@ -93,11 +93,6 @@ BrowserWindow.prototype._init = function () {
|
||||
this.on('restore', visibilityChanged)
|
||||
this.on('maximize', visibilityChanged)
|
||||
|
||||
// Make renderer process have correct initial state.
|
||||
if (!isVisible) {
|
||||
this.webContents.mergeWebPreferences({visibilityState: 'hidden'})
|
||||
}
|
||||
|
||||
// Notify the creation of the window.
|
||||
app.emit('browser-window-created', {}, this)
|
||||
|
||||
|
||||
@@ -58,8 +58,6 @@ for (let arg of process.argv) {
|
||||
nodeIntegration = arg.substr(arg.indexOf('=') + 1)
|
||||
} else if (arg.indexOf('--preload=') === 0) {
|
||||
preloadScript = arg.substr(arg.indexOf('=') + 1)
|
||||
} else if (arg.indexOf('--visibility-state=') === 0) {
|
||||
process.visibilityState = arg.substr(arg.indexOf('=') + 1)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -225,10 +225,7 @@ Object.defineProperty(window.history, 'length', {
|
||||
})
|
||||
|
||||
// The initial visibilityState.
|
||||
let cachedVisibilityState = 'visible'
|
||||
if (process.visibilityState) {
|
||||
cachedVisibilityState = process.visibilityState
|
||||
}
|
||||
let cachedVisibilityState = process.argv.includes('--hidden-page') ? 'hidden' : 'visible'
|
||||
|
||||
// Subscribe to visibilityState changes.
|
||||
ipcRenderer.on('ELECTRON_RENDERER_WINDOW_VISIBILITY_CHANGE', function (event, visibilityState) {
|
||||
|
||||
Reference in New Issue
Block a user