fix: revert use of IPC helpers for history due to failing test (#19189)
This commit is contained in:
parent
79114ff40a
commit
c756b955b3
2 changed files with 13 additions and 13 deletions
|
@ -1,22 +1,22 @@
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
const ipcMainUtils = require('@electron/internal/browser/ipc-main-internal-utils')
|
const { ipcMainInternal } = require('@electron/internal/browser/ipc-main-internal')
|
||||||
|
|
||||||
// The history operation in renderer is redirected to browser.
|
// The history operation in renderer is redirected to browser.
|
||||||
ipcMainUtils.handle('ELECTRON_NAVIGATION_CONTROLLER_GO_BACK', function (event) {
|
ipcMainInternal.on('ELECTRON_NAVIGATION_CONTROLLER_GO_BACK', function (event) {
|
||||||
return event.sender.goBack()
|
event.sender.goBack()
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcMainUtils.handle('ELECTRON_NAVIGATION_CONTROLLER_GO_FORWARD', function (event) {
|
ipcMainInternal.on('ELECTRON_NAVIGATION_CONTROLLER_GO_FORWARD', function (event) {
|
||||||
return event.sender.goForward()
|
event.sender.goForward()
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcMainUtils.handle('ELECTRON_NAVIGATION_CONTROLLER_GO_TO_OFFSET', function (event, offset) {
|
ipcMainInternal.on('ELECTRON_NAVIGATION_CONTROLLER_GO_TO_OFFSET', function (event, offset) {
|
||||||
return event.sender.goToOffset(offset)
|
event.sender.goToOffset(offset)
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcMainUtils.handle('ELECTRON_NAVIGATION_CONTROLLER_LENGTH', function (event) {
|
ipcMainInternal.on('ELECTRON_NAVIGATION_CONTROLLER_LENGTH', function (event) {
|
||||||
return event.sender.length()
|
event.returnValue = event.sender.length()
|
||||||
})
|
})
|
||||||
|
|
||||||
// JavaScript implementation of Chromium's NavigationController.
|
// JavaScript implementation of Chromium's NavigationController.
|
||||||
|
|
|
@ -224,20 +224,20 @@ export const windowSetup = (
|
||||||
})
|
})
|
||||||
|
|
||||||
window.history.back = function () {
|
window.history.back = function () {
|
||||||
ipcRendererUtils.invoke('ELECTRON_NAVIGATION_CONTROLLER_GO_BACK')
|
ipcRendererInternal.send('ELECTRON_NAVIGATION_CONTROLLER_GO_BACK')
|
||||||
}
|
}
|
||||||
|
|
||||||
window.history.forward = function () {
|
window.history.forward = function () {
|
||||||
ipcRendererUtils.invoke('ELECTRON_NAVIGATION_CONTROLLER_GO_FORWARD')
|
ipcRendererInternal.send('ELECTRON_NAVIGATION_CONTROLLER_GO_FORWARD')
|
||||||
}
|
}
|
||||||
|
|
||||||
window.history.go = function (offset: number) {
|
window.history.go = function (offset: number) {
|
||||||
ipcRendererUtils.invoke('ELECTRON_NAVIGATION_CONTROLLER_GO_TO_OFFSET', +offset)
|
ipcRendererInternal.send('ELECTRON_NAVIGATION_CONTROLLER_GO_TO_OFFSET', +offset)
|
||||||
}
|
}
|
||||||
|
|
||||||
Object.defineProperty(window.history, 'length', {
|
Object.defineProperty(window.history, 'length', {
|
||||||
get: function () {
|
get: function () {
|
||||||
return ipcRendererUtils.invokeSync('ELECTRON_NAVIGATION_CONTROLLER_LENGTH')
|
return ipcRendererInternal.sendSync('ELECTRON_NAVIGATION_CONTROLLER_LENGTH')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue