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

@ -175,7 +175,7 @@ class BrowserWindowProxy {
}
export const windowSetup = (
guestInstanceId: number, openerId: number, isHiddenPage: boolean, usesNativeWindowOpen: boolean
guestInstanceId: number, openerId: number, isHiddenPage: boolean, usesNativeWindowOpen: boolean, rendererProcessReuseEnabled: boolean
) => {
if (!process.sandboxed && guestInstanceId == null) {
// Override default window.close.
@ -229,7 +229,7 @@ export const windowSetup = (
})
}
if (!process.sandboxed) {
if (!process.sandboxed && !rendererProcessReuseEnabled) {
window.history.back = function () {
ipcRendererInternal.send('ELECTRON_NAVIGATION_CONTROLLER_GO_BACK')
}