fix(tabs): avoid raising automation window

This commit is contained in:
朴圣佑
2026-05-12 11:07:11 +08:00
parent 2bb34f9064
commit 80c3e6217f
3 changed files with 25 additions and 43 deletions
+3 -16
View File
@@ -36,22 +36,9 @@
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.
}
}
// Do not request window focus here. The automation tab is already
// locked to the selected Chrome window; raising that window would
// interrupt the user's active workspace.
if (typeof addLog === 'function') {
await addLog(