fix(tabs): scope payment task tab lookup

This commit is contained in:
朴圣佑
2026-05-12 11:10:03 +08:00
parent 80c3e6217f
commit 7a5b7a26cf
6 changed files with 58 additions and 6 deletions
+4 -1
View File
@@ -10,6 +10,7 @@
addLog,
broadcastDataUpdate,
chrome,
createAutomationTab = null,
getTabId,
isTabAlive,
registerTab,
@@ -48,7 +49,9 @@
throw new Error('步骤 7:无法自动重新打开 GoPay 订阅页。');
}
const tab = await chrome.tabs.create({ url: checkoutUrl, active: true });
const tab = typeof createAutomationTab === 'function'
? await createAutomationTab({ url: checkoutUrl, active: true })
: await chrome.tabs.create({ url: checkoutUrl, active: true });
const tabId = Number(tab?.id) || 0;
if (!tabId) {
throw new Error('步骤 7:重新打开 GoPay 订阅页失败。');