registerRoute
Registers a window as a route of the application.
The registerRoute
method returned by the createElectronRouter function registers a window as a route of the application.
This means that only the content defined from the corresponding route in the renderer process for that window will be displayed in it.
Basic Example
registerRoute({
id: 'main',
browserWindow: mainWindow,
htmlFile: path.join(__dirname, '../renderer/index.html'),
})
API Reference
Property | Type | Default |
---|---|---|
| string | main |
| object | |
| number | The port defined in the createElectronRouter function or 3000 |
| string | |
| string | |
| Electron.BrowserWindow |