mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
* perf: use an internal module resolver instead of relative requires * perf: memoize the results of getting exported Electron properties * perf: make internal module changes consistent across sandboxed / bundled files
22 lines
547 B
JavaScript
22 lines
547 B
JavaScript
const Event = require('@electron/internal/renderer/extensions/event')
|
|
const { ipcRenderer } = require('electron')
|
|
|
|
class WebNavigation {
|
|
constructor () {
|
|
this.onBeforeNavigate = new Event()
|
|
this.onCompleted = new Event()
|
|
|
|
ipcRenderer.on('CHROME_WEBNAVIGATION_ONBEFORENAVIGATE', (event, details) => {
|
|
this.onBeforeNavigate.emit(details)
|
|
})
|
|
|
|
ipcRenderer.on('CHROME_WEBNAVIGATION_ONCOMPLETED', (event, details) => {
|
|
this.onCompleted.emit(details)
|
|
})
|
|
}
|
|
}
|
|
|
|
exports.setup = () => {
|
|
return new WebNavigation()
|
|
}
|