feat: 增强注册流程,处理隐藏的注册入口并优化窗口状态

This commit is contained in:
QLHazyCoder
2026-05-10 19:55:13 +08:00
parent 48d3d5fc12
commit d058676f95
4 changed files with 220 additions and 7 deletions
+17
View File
@@ -35,6 +35,23 @@
return null;
}
if (typeof chrome?.tabs?.get === 'function' && typeof chrome?.windows?.update === 'function') {
try {
const tab = await chrome.tabs.get(tabId);
const windowId = Number(tab?.windowId);
if (Number.isInteger(windowId) && windowId >= 0) {
await chrome.windows.update(windowId, { state: 'normal', focused: true }).catch(() => {});
await chrome.windows.update(windowId, {
focused: true,
width: 1200,
height: 900,
}).catch(() => {});
}
} catch {
// Best-effort only. Step 2 still has content-side entry retries.
}
}
if (typeof addLog === 'function') {
await addLog(
`步骤 ${step}:注册页已打开,正在等待页面加载完成并额外稳定 3 秒...`,