fix(desktop): prevent packaged renderer white screen
This commit is contained in:
1 parent
b71daef0e3
commit
17c8181f85
9 files changed
+136
-9
No files matched your search
@@ -17,10 +17,6 @@ const browser = await chromium.launch({
|
||||
headless: true,
|
||||
args: [
|
||||
"--allow-file-access-from-files",
|
||||
// Electron permits the packaged renderer to normalize index.html to the
|
||||
// file:// root. Match that behavior so this check exercises module
|
||||
// evaluation rather than failing inside Chromium's stricter file history.
|
||||
"--disable-web-security",
|
||||
],
|
||||
});
|
||||
|
||||
@@ -37,6 +33,9 @@ try {
|
||||
// Keep observing long enough to catch post-mount update loops that leave
|
||||
// packaged desktop windows blank after briefly rendering.
|
||||
await page.waitForTimeout(2_000);
|
||||
if (await page.locator(readySelector).first().count() === 0) {
|
||||
throw new Error(`${label} disappeared after startup.`);
|
||||
}
|
||||
} catch (error) {
|
||||
if (pageErrors.length === 0) throw error;
|
||||
} finally {
|
||||
|
||||
Reference in new issue
Block a user