Skip to content

Latest commit

 

History

History
28 lines (22 loc) · 1.25 KB

electron-integration.md

File metadata and controls

28 lines (22 loc) · 1.25 KB
title slug createdAt updatedAt
Electron Support
electron-integration
2022-09-29 04:16:22 UTC
2022-10-13 18:04:13 UTC

If you are running Highlight in Electron, a Desktop based JS framework, you can benefit from the additional functionality that tracks main process window events to stop and start Highlight recording when your app is minimized.

Please ensure you are using Highlight SDK version highlight.run@4.3.4. or higher. Call configureElectronHighlight with a BrowserWindow object to instrument Electron events.

const mainWindow = new BrowserWindow(...)
configureElectronHighlight(mainWindow)

Under the hood, the function will forward the focus and blur events to your renderer process so that the highlight recording SDK can track them.

mainWindow.on('focus', () => {
    mainWindow.webContents.send('highlight.run', { visible: true });
});
window.on('blur', () => {
    mainWindow.webContents.send('highlight.run', { visible: false });
 });

This will stop all highlight recording when the app is not visible and resume the session when the app regains visibility to help minimize performance and battery impact that Highlight may have on Electron users.