chore: do not override history methods when rendererprocessreuse is enabled (#22335)

This commit is contained in:
Samuel Attard 2020-02-24 12:14:11 -08:00 committed by GitHub
parent fd46bc653f
commit 360c1cad1b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 10 deletions

View file

@ -116,10 +116,11 @@ const { hasSwitch } = process.electronBinding('command_line')
const contextIsolation = hasSwitch('context-isolation')
const isHiddenPage = hasSwitch('hidden-page')
const rendererProcessReuseEnabled = hasSwitch('disable-electron-site-instance-overrides')
const usesNativeWindowOpen = true
// The arguments to be passed to isolated world.
const isolatedWorldArgs = { ipcRendererInternal, guestInstanceId, isHiddenPage, openerId, usesNativeWindowOpen }
const isolatedWorldArgs = { ipcRendererInternal, guestInstanceId, isHiddenPage, openerId, usesNativeWindowOpen, rendererProcessReuseEnabled }
switch (window.location.protocol) {
case 'devtools:': {
@ -140,7 +141,7 @@ switch (window.location.protocol) {
default: {
// Override default web functions.
const { windowSetup } = require('@electron/internal/renderer/window-setup')
windowSetup(guestInstanceId, openerId, isHiddenPage, usesNativeWindowOpen)
windowSetup(guestInstanceId, openerId, isHiddenPage, usesNativeWindowOpen, rendererProcessReuseEnabled)
// Inject content scripts.
if (!process.electronBinding('features').isExtensionsEnabled()) {