Merge remote-tracking branch 'origin/master' into roller/chromium-ad1b791122c04bd91b825fbfbdf1ff4da82a0edb-1558011686736

This commit is contained in:
Jeremy Apthorp 2019-05-21 10:07:17 -07:00
commit ca283c74c9
64 changed files with 2026 additions and 3216 deletions

View file

@ -47,7 +47,11 @@ const checkAppInitialized = function () {
const saveDialog = (sync, window, options) => {
checkAppInitialized()
if (window && window.constructor !== BrowserWindow) options = window
if (window && window.constructor !== BrowserWindow) {
options = window
window = null
}
if (options == null) options = { title: 'Save' }
const {
@ -74,7 +78,11 @@ const saveDialog = (sync, window, options) => {
const openDialog = (sync, window, options) => {
checkAppInitialized()
if (window && window.constructor !== BrowserWindow) options = window
if (window && window.constructor !== BrowserWindow) {
options = window
window = null
}
if (options == null) {
options = {
title: 'Open',
@ -115,7 +123,11 @@ const openDialog = (sync, window, options) => {
const messageBox = (sync, window, options) => {
checkAppInitialized()
if (window && window.constructor !== BrowserWindow) options = window
if (window && window.constructor !== BrowserWindow) {
options = window
window = null
}
if (options == null) options = { type: 'none' }
const messageBoxTypes = ['none', 'info', 'warning', 'error', 'question']

View file

@ -354,9 +354,6 @@ WebContents.prototype._init = function () {
app.emit('renderer-process-crashed', event, this, ...args)
})
deprecate.event(this, 'did-get-response-details', '-did-get-response-details')
deprecate.event(this, 'did-get-redirect-request', '-did-get-redirect-request')
// The devtools requests the webContents to reload.
this.on('devtools-reload-page', function () {
this.reload()

View file

@ -93,7 +93,7 @@ const startBackgroundPages = function (manifest) {
const contents = webContents.create({
partition: 'persist:__chrome_extension',
isBackgroundPage: true,
type: 'backgroundPage',
sandbox: true,
enableRemoteModule: false
})

View file

@ -59,7 +59,7 @@ const createGuest = function (embedder, params) {
}
const guest = webContents.create({
isGuest: true,
type: 'webview',
partition: params.partition,
embedder: embedder
})

View file

@ -28,7 +28,7 @@ const mergeOptions = function (child, parent, visited) {
visited.add(parent)
for (const key in parent) {
if (key === 'isBrowserView') continue
if (key === 'type') continue
if (!hasProp.call(parent, key)) continue
if (key in child && key !== 'webPreferences') continue
@ -244,7 +244,7 @@ ipcMainInternal.on('ELECTRON_GUEST_WINDOW_MANAGER_INTERNAL_WINDOW_OPEN', functio
options = mergeBrowserWindowOptions(event.sender, options)
event.sender.emit('new-window', event, url, frameName, disposition, options, additionalFeatures, referrer)
const { newGuest } = event
if ((event.sender.isGuest() && !event.sender.allowPopups) || event.defaultPrevented) {
if ((event.sender.getType() === 'webview' && !event.sender.allowPopups) || event.defaultPrevented) {
if (newGuest != null) {
if (options.webContents === newGuest.webContents) {
// the webContents is not changed, so set defaultPrevented to false to