dsh-oc-desktop 0.3.11 → 0.3.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/launcher/main.js +10 -2
- package/package.json +1 -1
package/launcher/main.js
CHANGED
|
@@ -409,8 +409,16 @@ function createMainWindow(url) {
|
|
|
409
409
|
win.on('resize', saveStateDebounced);
|
|
410
410
|
win.on('move', saveStateDebounced);
|
|
411
411
|
attachShellGuards(win);
|
|
412
|
-
win.webContents.on('did-fail-load', (e, code, desc) => {
|
|
413
|
-
|
|
412
|
+
win.webContents.on('did-fail-load', (e, code, desc, url, isMainFrame) => {
|
|
413
|
+
// -3 (ERR_ABORTED) 是正常的中止(导航被替换/用户取消),不算失败
|
|
414
|
+
if (code === -3) return;
|
|
415
|
+
// 子框架(iframe)加载失败(如某个预览面板尝试连本地 5173)不应整页报错,
|
|
416
|
+
// 否则会把已正常加载的 harness 页面覆盖成错误页。仅记日志。
|
|
417
|
+
if (!isMainFrame) {
|
|
418
|
+
log('warn', `subframe load failed (${code} ${desc}) url=${url}`);
|
|
419
|
+
return;
|
|
420
|
+
}
|
|
421
|
+
showError(`页面加载失败 (${code} ${desc})`);
|
|
414
422
|
});
|
|
415
423
|
return win;
|
|
416
424
|
}
|
package/package.json
CHANGED