mirror of
https://github.com/stablyai/orca.git
synced 2026-11-13 09:27:29 +00:00
* refactor(window): group clipboard, lifecycle, security, and relay owners * refactor(window): keep Electron paste handling with desktop clipboard
23 lines
844 B
TypeScript
23 lines
844 B
TypeScript
import { app, BrowserWindow } from 'electron'
|
|
import path from 'node:path'
|
|
import { applyBackgroundActivationPolicy } from '../../../../src/main/window/activation/foreground-activation-policy'
|
|
|
|
if (process.env.ORCA_BACKGROUND_LAUNCH !== '1') {
|
|
throw new Error('Spinner measurements require ORCA_BACKGROUND_LAUNCH=1')
|
|
}
|
|
app.setPath('userData', path.join(__dirname, 'profile'))
|
|
applyBackgroundActivationPolicy()
|
|
// Exercise the frame pipeline while keeping the native window hidden.
|
|
app.commandLine.appendSwitch('disable-backgrounding-occluded-windows')
|
|
app.commandLine.appendSwitch('disable-renderer-backgrounding')
|
|
|
|
void app.whenReady().then(async () => {
|
|
const window = new BrowserWindow({
|
|
show: false,
|
|
width: 1100,
|
|
height: 850,
|
|
webPreferences: { backgroundThrottling: false }
|
|
})
|
|
await window.loadURL('about:blank')
|
|
})
|