()
| 14 | let closing = false; |
| 15 | |
| 16 | export function getBrowser(): Promise<Browser> { |
| 17 | if (closing) { |
| 18 | return Promise.reject(new Error("renderer is shutting down")); |
| 19 | } |
| 20 | if (!browserPromise) { |
| 21 | browserPromise = chromium.launch({ args: ["--no-sandbox"] }); |
| 22 | } |
| 23 | return browserPromise; |
| 24 | } |
| 25 | |
| 26 | export async function closeBrowser(): Promise<void> { |
| 27 | if (!browserPromise) return; |
no outgoing calls
no test coverage detected