(tabId: number)
| 107 | } |
| 108 | |
| 109 | export async function getTab(tabId: number) { |
| 110 | return await chrome.tabs.get(tabId).catch(() => undefined); |
| 111 | } |
| 112 | |
| 113 | // 在当前页后打开一个新页面,如果指定tabId则在该tab后打开 |
| 114 | export async function openInCurrentTab(url: string, tabId?: number): Promise<chrome.tabs.Tab | undefined> { |